al_get_text_dimensions(3)

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

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 case x and y will 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