ttfSetFontScript function ttf
Set the script to be used for text shaping by a font.
This returns false if SDL_ttf isn't built with HarfBuzz support.
This updates any TTF_Text objects using this font.
\param font the font to modify. \param script an ISO 15924 code . \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 the font.
\since This function is available since SDL_ttf 3.0.0.
\sa TTF_StringToTag
extern SDL_DECLSPEC bool SDLCALL TTF_SetFontScript(TTF_Font *font, Uint32 script)
Implementation
bool ttfSetFontScript(Pointer<TtfFont> font, int script) {
final ttfSetFontScriptLookupFunction = _libTtf
.lookupFunction<
Uint8 Function(Pointer<TtfFont> font, Uint32 script),
int Function(Pointer<TtfFont> font, int script)
>('TTF_SetFontScript');
return ttfSetFontScriptLookupFunction(font, script) == 1;
}