al_get_text_dimensions(3)
al_get_text_dimensions(3) π β¨
okay bestie, welcome to the Allegro reference manual page for al_get_text_dimensions β sheβs giving βI know exactly where your text bounding box livesβ energy π
πΈ NAME πΈ
al_get_text_dimensions β Allegro 5 API, and yes sheβs here to spill the dimensions π
β¨ SYNOPSIS β¨
#include <allegro5/allegro_font.h>
void al_get_text_dimensions(const ALLEGRO_FONT *f,
char const *text,
int *bbx, int *bby, int *bbw, int *bbh)
π DESCRIPTION π
Sometimes, al_get_text_width(3) and al_get_font_line_height(3) are literally not enough for exact text placement, so this function returns some additional information. Thatβs the whole gig, no cap π«Ά
Returned variables (all in pixels):
x,yβ offset to upper left corner of bounding box.w,hβ dimensions of bounding box.
β οΈ Note that glyphs may go to the left and upwards of the X, in which casexandywill have negative values. So yeah, negative numbers can absolutely show up β sheβs not bugging, thatβs just the bounding box being real π
π¦ SEE ALSO π¦
source/version: Allegro reference manual; date: not listed on this page, so no fake timestamp energy here β thatβs all she wrote, bestie ππβ¨
π¦ 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