TTF_AddFallbackFont(3)
π TTF_AddFallbackFont(3) π
okay bestie, so this is a page from the SDL_ttf3 FUNCTIONS manual, and it's about making your fonts have a little backup squad. no cap. π«Ά
πΈ NAME πΈ
TTF_AddFallbackFont β Add a fallback font.
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_AddFallbackFont(TTF_Font *font, TTF_Font *fallback);
π DESCRIPTION π
so basically? you're adding a font that gets used for glyphs that are not in the current font. it's giving "if my main font doesn't have this character, bestie here will cover for it." π
the fallback font should have the same size and style as the current font. literally matching energy only.
if there are multiple fallback fonts, they are used in the order added. first come, first served, periodt. π
and yes, this updates any TTF_Text objects using this font. no need to go rebuild them yourself, she handles it. π¦
π 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. if it flops, call SDL_GetError() for more information β she'll tell you what went wrong, fr fr. π
π₯ THREAD SAFETY π₯
This function should be called on the thread that created both fonts. both of them. don't be messy about it. π
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0.
π§ SEE ALSO π§
β’(3)TTF_ClearFallbackFonts(3)β’(3)TTF_RemoveFallbackFont(3)
not me making font fallbacks sound like a group chat. but like, that's literally what they are. πΈ
that's the whole page, bestie β stay iconic, keep your glyphs covered, and remember: this was brought to you by SDL_ttf version 3.2.2. slay π β¨
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms