ttfGetFontKerningSizeGlyphs function

int ttfGetFontKerningSizeGlyphs(
  1. Pointer<TtfFont> font,
  2. int previousCh,
  3. int ch
)

Query the kerning size of two 16-bit glyphs.

Note that this version of the function takes 16-bit character codes, which covers the Basic Multilingual Plane, but is insufficient to cover the entire set of possible Unicode values, including emoji glyphs. You should use TTF_GetFontKerningSizeGlyphs32() instead, which offers the same functionality but takes a 32-bit codepoints instead.

The only reason to use this function is that it was available since the beginning of time, more or less.

\param font the font to query. \param previous_ch the previous character's code, 16 bits. \param ch the current character's code, 16 bits. \returns The kerning size between the two specified characters, in pixels, or -1 on error.

\since This function is available since SDL_ttf 2.0.14.

\sa TTF_GetFontKerningSizeGlyphs32

extern DECLSPEC int TTF_GetFontKerningSizeGlyphs(TTF_Font *font, Uint16 previous_ch, Uint16 ch)

Implementation

int ttfGetFontKerningSizeGlyphs(Pointer<TtfFont> font, int previousCh, int ch) {
  final ttfGetFontKerningSizeGlyphsLookupFunction = libSdl2Ttf.lookupFunction<
      Int32 Function(Pointer<TtfFont> font, Uint16 previousCh, Uint16 ch),
      int Function(Pointer<TtfFont> font, int previousCh,
          int ch)>('TTF_GetFontKerningSizeGlyphs');
  return ttfGetFontKerningSizeGlyphsLookupFunction(font, previousCh, ch);
}