ttfGetGlyphScript function

bool ttfGetGlyphScript(
  1. int ch,
  2. Pointer<Int8> script,
  3. int scriptSize
)

Get the script used by a 32-bit codepoint.

The supplied script value will be a null-terminated string of exactly four characters.

If SDL_ttf was not built with HarfBuzz support, this function returns false.

\param ch the character code to check. \param script a pointer filled in with the script used by ch. \param script_size the size of the script buffer, which must be at least 5 characters. \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.

extern SDL_DECLSPEC bool SDLCALL TTF_GetGlyphScript(Uint32 ch, char *script, size_t script_size)

Implementation

bool ttfGetGlyphScript(int ch, Pointer<Int8> script, int scriptSize) {
  final ttfGetGlyphScriptLookupFunction = libSdl3Ttf.lookupFunction<
      Uint8 Function(Uint32 ch, Pointer<Int8> script, Uint32 scriptSize),
      int Function(
          int ch, Pointer<Int8> script, int scriptSize)>('TTF_GetGlyphScript');
  return ttfGetGlyphScriptLookupFunction(ch, script, scriptSize) == 1;
}