stbtt_GetScaledFontVMetrics function

  1. @Native<Void Function(Pointer<ma_uint8>, Int, Float, Pointer<Float>, Pointer<Float>, Pointer<Float>)>(ffi.Pointer<ffi.UnsignedChar>, ffi.Int, ffi.Float, ffi.Pointer<ffi.Float>, ffi.Pointer<ffi.Float>, ffi.Pointer<ffi.Float>)>()
void stbtt_GetScaledFontVMetrics(
  1. Pointer<ma_uint8> fontdata,
  2. int index,
  3. double size,
  4. Pointer<Float> ascent,
  5. Pointer<Float> descent,
  6. Pointer<Float> lineGap,
)

Call GetBakedQuad with char_index = 'character - first_char', and it creates the quad you need to draw and advances the current position.

The coordinate system used assumes y increases downwards.

Characters will extend both above and below the current position; see discussion of "BASELINE" above.

It's inefficient; you might want to c&p it and optimize it.

Implementation

@ffi.Native<
  ffi.Void Function(
    ffi.Pointer<ffi.UnsignedChar>,
    ffi.Int,
    ffi.Float,
    ffi.Pointer<ffi.Float>,
    ffi.Pointer<ffi.Float>,
    ffi.Pointer<ffi.Float>,
  )
>()
external void stbtt_GetScaledFontVMetrics(
  ffi.Pointer<ffi.UnsignedChar> fontdata,
  int index,
  double size,
  ffi.Pointer<ffi.Float> ascent,
  ffi.Pointer<ffi.Float> descent,
  ffi.Pointer<ffi.Float> lineGap,
);