al_set_fallback_font(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_set_fallback_font(3alleg5) πŸ’–

okay bestie, welcome to the al_set_fallback_font(3alleg5) page of the Allegro 5 manual β€” yes that manual, the one from the allegro5 family of manpages. sit down, hydrate, and let's talk about what to do when your font is missing a glyph 🫢


✨ SYNOPSIS ✨

like, the actual signature, no cap:

#include <allegro5/allegro_font.h>

void al_set_fallback_font(ALLEGRO_FONT *font, ALLEGRO_FONT *fallback)

two pointers, one job. iconic behavior honestly πŸ’…


🌸 DESCRIPTION 🌸

so basically: this function sets a font that gets used instead whenever a character isn't present in the font you're drawing with. like, your main font ghosted that glyph, so the fallback font steps in and covers for it. main character energy from a backup font, we love to see it ✨

  • you can chain fallback fonts β€” font A falls back to B, B falls back to C, etc., it's giving relay race πŸƒβ™€οΈ
  • but make sure there is no loop, because a loop would crash the application! πŸ’€ fr fr, do not do that, that's not a vibe
  • and if you wanna remove a fallback font again? just pass NULL. poof, gone, no more fallback, bye πŸŽ€

⭐ SINCE ⭐

5.1.12 β€” so if your Allegro is older than that, this one's not for you bestie 😭


πŸ‘‘ SEE ALSO πŸ‘‘


lowkey reminder: chained fallbacks = fine, fallback loops = πŸ’€. NULL removes. that's the whole tea.

and that's the page!! this was the Allegro reference manual version of al_set_fallback_font(3alleg5) β€” go forth and give every glyph a home πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from