al_get_ustr_dimensions(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’… al_get_ustr_dimensions(3)

okay so this page lives in the Library Functions Manual and it's about Allegro 5 API β€” yes, the games-and-graphics one, hi bestie πŸŽ€


✨ NAME ✨

al_get_ustr_dimensions β€” literally the Allegro 5 API function that tells you how big your text is gonna be when it's an ALLEGRO_USTR πŸ’–


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_font.h>

void al_get_ustr_dimensions(const ALLEGRO_FONT *f,
   ALLEGRO_USTR const *ustr,
   int *bbx, int *bby, int *bbw, int *bbh)

like… that's the whole vibe. one font, one string, four ints. slay 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So bestie, picture al_get_text_dimensions(3) β€” iconic, love her β€” except the text you're passing in is an ALLEGRO_USTR instead of a NUL-terminated char array. that's it. that's the whole difference. same energy, different container πŸ’…

no cap, if you already know how al_get_text_dimensions(3) works, you already know how this works. the way that ustr just slides in where the char array was… main character energy honestly πŸ‘‘

the four int pointers are your bounding-box outs β€” bbx, bby, bbw, bbh β€” so hand it somewhere to write and it'll do its thing. (they're int *, so like, actually give it real memory, not NULL, iykyk 😭)


🌈 SEE ALSO 🌈


lowkey the whole page is short but she ate and left no crumbs ✨ nothing dangerous here, no deprecated nonsense, just a very chill little function fr fr πŸ“

and that's a wrap, bestie!! this came straight from the Allegro reference manual β€” al_get_ustr_dimensions(3), mwah πŸ’‹πŸ¦‹ see you in the next man page, bye!! πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms