ttfAddFallbackFont function ttf

bool ttfAddFallbackFont(
  1. Pointer<TtfFont> font,
  2. Pointer<TtfFont> fallback
)

Add a fallback font.

Add a font that will be used for glyphs that are not in the current font. The fallback font should have the same size and style as the current font.

If there are multiple fallback fonts, they are used in the order added.

This updates any TTF_Text objects using this font.

\param font the font to modify. \param fallback the font to add as a fallback. \returns true on success or false on failure; call SDL_GetError() for more information.

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

\since This function is available since SDL_ttf 3.0.0.

\sa TTF_ClearFallbackFonts \sa TTF_RemoveFallbackFont

extern SDL_DECLSPEC bool SDLCALL TTF_AddFallbackFont(TTF_Font *font, TTF_Font *fallback)

Implementation

bool ttfAddFallbackFont(Pointer<TtfFont> font, Pointer<TtfFont> fallback) {
  final ttfAddFallbackFontLookupFunction = _libTtf
      .lookupFunction<
        Uint8 Function(Pointer<TtfFont> font, Pointer<TtfFont> fallback),
        int Function(Pointer<TtfFont> font, Pointer<TtfFont> fallback)
      >('TTF_AddFallbackFont');
  return ttfAddFallbackFontLookupFunction(font, fallback) == 1;
}