ttfGlyphMetrics32 function

int ttfGlyphMetrics32(
  1. Pointer<TtfFont> font,
  2. int ch,
  3. Pointer<Int32> minx,
  4. Pointer<Int32> maxx,
  5. Pointer<Int32> miny,
  6. Pointer<Int32> maxy,
  7. Pointer<Int32> advance,
)

Query the metrics (dimensions) of a font's 32-bit glyph.

To understand what these metrics mean, here is a useful link:

https://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html

This is the same as TTF_GlyphMetrics(), but takes a 32-bit character instead of 16-bit, and thus can query a larger range. If you are sure you'll have an SDL_ttf that's version 2.0.18 or newer, there's no reason not to use this function exclusively.

\param font the font to query. \param ch the character code to check.

\since This function is available since SDL_ttf 2.0.18.

extern DECLSPEC int SDLCALL TTF_GlyphMetrics32(TTF_Font *font, Uint32 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance)

Implementation

int ttfGlyphMetrics32(
    Pointer<TtfFont> font,
    int ch,
    Pointer<Int32> minx,
    Pointer<Int32> maxx,
    Pointer<Int32> miny,
    Pointer<Int32> maxy,
    Pointer<Int32> advance) {
  final ttfGlyphMetrics32LookupFunction = libSdl2Ttf.lookupFunction<
      Int32 Function(
          Pointer<TtfFont> font,
          Uint32 ch,
          Pointer<Int32> minx,
          Pointer<Int32> maxx,
          Pointer<Int32> miny,
          Pointer<Int32> maxy,
          Pointer<Int32> advance),
      int Function(
          Pointer<TtfFont> font,
          int ch,
          Pointer<Int32> minx,
          Pointer<Int32> maxx,
          Pointer<Int32> miny,
          Pointer<Int32> maxy,
          Pointer<Int32> advance)>('TTF_GlyphMetrics32');
  return ttfGlyphMetrics32LookupFunction(
      font, ch, minx, maxx, miny, maxy, advance);
}