setSdf method

bool setSdf(
  1. bool enabled
)

Enable Signed Distance Field rendering for a font.

This works with the Blended APIs. SDF is a technique that helps fonts look sharp even when scaling and rotating.

This updates any TTF_Text objects using this font, and clears already-generated glyphs, if any, from the cache.

\param font the font to set SDF support on. \param enabled true to enable SDF, false to disable. \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_GetFontSDF

extern SDL_DECLSPEC bool TTF_SetFontSDF(TTF_Font *font, bool enabled)

Implementation

bool setSdf(bool enabled) {
  return ttfSetFontSdf(this, enabled);
}