al_init_font_addon(3alleg5)

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

✨ al_init_font_addon(3alleg5) ✨

okay bestie, so this is a page from the Allegro reference manual (yes, the 3alleg5 one, Allegro 5 API energy πŸ’–) and it's all about al_init_font_addon. fonts!! let's get into it πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_font.h>

bool al_init_font_addon(void)

look at her. one include, one function, zero drama ✨


πŸ’… DESCRIPTION πŸ’…

So the whole point of al_init_font_addon is literally just: initialise the font addon. that's it, that's the job, she's a one-task icon πŸ‘‘

But wait, there's lore. 🫢 If you're planning to load bitmap fonts, you're gonna need to initialise allegro_image separately β€” like, on its own, as its own whole thing. unless… you're using some other library to load images, in which case carry on, you're fine πŸ’œ

And similarly (the manpage literally says similarly, so we're saying similarly 😌), if you wanna load truetype-fonts, do not forget to also call al_init_ttf_addon(3alleg5). don't forget it. write it on your hand. put it in your notes app. whatever works πŸ¦‹

Now the return value tea: it returns true on success, false on failure. BUT 🚨 β€” on the 5.0 branch, this function has no return value at all. so if your code needs to be compatible with Allegro 5.0, you may wanna skip checking the return value entirely. and honestly? currently the function will never return false, so the check is lowkey doing nothing anyway πŸ’€ no cap.


🌈 SEE ALSO 🌈

go read those too, they're all connected, it's giving family reunion πŸ˜­πŸ’–


and that's the page!! brought to you by the Allegro reference manual, starring al_init_font_addon(3alleg5) in the leading role πŸ’…βœ¨ mwah, go initialise those fonts bestie, you got this 🫢🌸

πŸ“¦ where this page comes from