ttfFontHasGlyph function

bool ttfFontHasGlyph(
  1. Pointer<TtfFont> font,
  2. int ch
)

Check whether a glyph is provided by the font for a UNICODE codepoint.

\param font the font to query. \param ch the codepoint to check. \returns true if font provides a glyph for this character, false if not.

\threadsafety This function should be called on the thread that created the font.

\since This function is available since SDL_ttf 3.0.0.

extern SDL_DECLSPEC bool SDLCALL TTF_FontHasGlyph(TTF_Font *font, Uint32 ch)

Implementation

bool ttfFontHasGlyph(Pointer<TtfFont> font, int ch) {
  final ttfFontHasGlyphLookupFunction = libSdl3Ttf.lookupFunction<
      Uint8 Function(Pointer<TtfFont> font, Uint32 ch),
      int Function(Pointer<TtfFont> font, int ch)>('TTF_FontHasGlyph');
  return ttfFontHasGlyphLookupFunction(font, ch) == 1;
}