stbtt_GetScaledFontVMetrics function
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,
);