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 🧚


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