stbtt_GetFontVMetricsOS2 function

  1. @Native<Int Function(Pointer<stbtt_fontinfo>, Pointer<Int>, Pointer<Int>, Pointer<Int>)>(ffi.Pointer<stbtt_fontinfo>, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>)>()
int stbtt_GetFontVMetricsOS2(
  1. Pointer<stbtt_fontinfo> info,
  2. Pointer<Int> typoAscent,
  3. Pointer<Int> typoDescent,
  4. Pointer<Int> typoLineGap,
)

ascent is the coordinate above the baseline the font extends; descent is the coordinate below the baseline the font extends (i.e. it is typically negative) lineGap is the spacing between one row's descent and the next row's ascent... so you should advance the vertical position by "*ascent - *descent + *lineGap" these are expressed in unscaled coordinates, so you must multiply by the scale factor for a given size

Implementation

@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<stbtt_fontinfo>,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
  )
>()
external int stbtt_GetFontVMetricsOS2(
  ffi.Pointer<stbtt_fontinfo> info,
  ffi.Pointer<ffi.Int> typoAscent,
  ffi.Pointer<ffi.Int> typoDescent,
  ffi.Pointer<ffi.Int> typoLineGap,
);