stbtt_GetCodepointBitmapSubpixel function

  1. @Native<Pointer<ma_uint8> Function(Pointer<stbtt_fontinfo>, Float, Float, Float, Float, Int, Pointer<Int>, Pointer<Int>, Pointer<Int>, Pointer<Int>)>(ffi.Pointer<stbtt_fontinfo>, ffi.Float, ffi.Float, ffi.Float, ffi.Float, ffi.Int, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>)>()
Pointer<ma_uint8> stbtt_GetCodepointBitmapSubpixel(
  1. Pointer<stbtt_fontinfo> info,
  2. double scale_x,
  3. double scale_y,
  4. double shift_x,
  5. double shift_y,
  6. int codepoint,
  7. Pointer<Int> width,
  8. Pointer<Int> height,
  9. Pointer<Int> xoff,
  10. Pointer<Int> yoff,
)

allocates a large-enough single-channel 8bpp bitmap and renders the specified character/glyph at the specified scale into it, with antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). *width & *height are filled out with the width & height of the bitmap, which is stored left-to-right, top-to-bottom.

xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap

Implementation

@ffi.Native<
  ffi.Pointer<ffi.UnsignedChar> Function(
    ffi.Pointer<stbtt_fontinfo>,
    ffi.Float,
    ffi.Float,
    ffi.Float,
    ffi.Float,
    ffi.Int,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
    ffi.Pointer<ffi.Int>,
  )
>()
external ffi.Pointer<ffi.UnsignedChar> stbtt_GetCodepointBitmapSubpixel(
  ffi.Pointer<stbtt_fontinfo> info,
  double scale_x,
  double scale_y,
  double shift_x,
  double shift_y,
  int codepoint,
  ffi.Pointer<ffi.Int> width,
  ffi.Pointer<ffi.Int> height,
  ffi.Pointer<ffi.Int> xoff,
  ffi.Pointer<ffi.Int> yoff,
);