ttfGetFontDirection function

int ttfGetFontDirection(
  1. Pointer<TtfFont> font
)

Get direction to be used for text shaping by a font.

Possible direction values are:

  • TTF_DIRECTION_LTR (Left to Right)
  • TTF_DIRECTION_RTL (Right to Left)
  • TTF_DIRECTION_TTB (Top to Bottom)
  • TTF_DIRECTION_BTT (Bottom to Top)

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

\param font the font to query. \returns the direction to be used for text shaping.

\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 TTF_Direction SDLCALL TTF_GetFontDirection(TTF_Font *font)

Implementation

int ttfGetFontDirection(Pointer<TtfFont> font) {
  final ttfGetFontDirectionLookupFunction = libSdl3Ttf.lookupFunction<
      Int32 Function(Pointer<TtfFont> font),
      int Function(Pointer<TtfFont> font)>('TTF_GetFontDirection');
  return ttfGetFontDirectionLookupFunction(font);
}