stbtt_ScaleForMappingEmToPixels function

  1. @Native<Float Function(Pointer<stbtt_fontinfo>, Float)>(ffi.Pointer<stbtt_fontinfo>, ffi.Float)>()
double stbtt_ScaleForMappingEmToPixels(
  1. Pointer<stbtt_fontinfo> info,
  2. double pixels
)

computes a scale factor to produce a font whose "height" is 'pixels' tall. Height is measured as the distance from the highest ascender to the lowest descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics and computing: scale = pixels / (ascent - descent) so if you prefer to measure height by the ascent only, use a similar calculation.

Implementation

@ffi.Native<ffi.Float Function(ffi.Pointer<stbtt_fontinfo>, ffi.Float)>()
external double stbtt_ScaleForMappingEmToPixels(
  ffi.Pointer<stbtt_fontinfo> info,
  double pixels,
);