ttfSetFontCharSpacing function ttf

bool ttfSetFontCharSpacing(
  1. Pointer<TtfFont> font,
  2. int spacing
)

Set additional space in pixels to be applied between any two rendered characters.

The spacing value is applied uniformly after each character, in addition to the normal glyph's advance.

Spacing may be a negative value, in which case it will reduce the distance instead.

This updates any TTF_Text objects using this font.

\param font the font to specify a direction for. \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.4.0.

extern SDL_DECLSPEC bool SDLCALL TTF_SetFontCharSpacing(TTF_Font *font, int spacing)

Implementation

bool ttfSetFontCharSpacing(Pointer<TtfFont> font, int spacing) {
  final ttfSetFontCharSpacingLookupFunction = _libTtf
      .lookupFunction<
        Uint8 Function(Pointer<TtfFont> font, Int32 spacing),
        int Function(Pointer<TtfFont> font, int spacing)
      >('TTF_SetFontCharSpacing');
  return ttfSetFontCharSpacingLookupFunction(font, spacing) == 1;
}