TTF_AddFallbackFont(3)

TTF_AddFallbackFont3

Add a fallback font.

Usage

#include "SDL3_ttf/SDL_ttf.h"

bool TTF_AddFallbackFont(TTF_Font *font, TTF_Font *fallback);

Header file

Defined in SDL3_ttf/SDL_ttf.h

Overview

Add a font that will be used for glyphs that are not in the current font. The fallback font should have the same size and style as the current font.

If there are multiple fallback fonts, they are used in the order added.

This updates any TTF_Text
objects using this font.

Function parameters

font

the font to modify.

fallback

the font to add as a fallback.

Return value

Returns true on success or false on failure; call SDL_GetError() for more information.

Thread safety

This function should be called on the thread that created both fonts.

Availability

This function is available since SDL_ttf 3.0.0.

From libsdl3-ttf-doc 3.2.2+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.