al_get_ustr_dimensions(3)
π 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 π
al_get_text_dimensions(3)β the NUL-terminated-char-array sibling, the OG, go read her too π
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