text_height(3)
β¨ text_height β like, the height of a font, bestie β¨
okay so real quick, this one lives in the Allegro manual (section 3, the library-call girlies π ), and it's genuinely one of the most useful little functions you'll ever meet. no cap.
π NAME π
text_height β returns the height of a font in pixels. part of the Allegro game programming library, and yes she's iconic for it.
πΈ SYNOPSIS πΈ
#include <allegro.h>
int text_height(const FONT *f)
π DESCRIPTION π
so basically: she hands you back the height (in pixels, obviously π ) of whatever font you point her at. that's it. that's the whole vibe. one number, zero drama.
like, say you've got a font and you need to know how tall it's gonna render so you can size a bitmap around it β this is literally the function for that. example time, watch:
int height = text_height(font);
...
bmp = create_bitmap(width, height);
see how she slotted height straight into create_bitmap? that's the whole point. main character energy fr fr. π«Ά
π¦ SEE ALSO π¦
ngl if you're measuring text and you don't check bothtext_heightandtext_length, that's a vibe check you're failing. π
okay bye ily, this page came to you from Allegro, version 4.4.3 β and text_height(3) says mwah, go build something cute ππΈπ§
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms