al_get_font_line_height(3alleg5)
β¨ al_get_font_line_height β¨
okay bestie, welcome to the Allegro 5 API π this one's from the Allegro reference manual and it's short but it's important, so let's go π«Ά
π NAME π
al_get_font_line_height β Allegro 5 API πΈ
π SYNOPSIS π
#include <allegro5/allegro_font.h>
int al_get_font_line_height(const ALLEGRO_FONT *f)
no cap, that's the whole signature. one font pointer in, one int out. iconic. π
π¦ DESCRIPTION π¦
so what does it do?? it returns the usual height of a line of text in the specified font. that's it. that's the vibe. β¨
the deets depend on what kind of font you're rolling with:
- for bitmap fonts, it's literally just the height of all the glyph bitmaps. simple. no drama. π
- for truetype fonts, it's whatever the font file itself specifies. the font said what it said. π§
heads up tho: some special glyphs may be higher than the height returned here. so don't come for this function if your fancy glyph is popping off the top, that's just how it is π
and if X is the position you specify to draw text, then the meaning of ascent, descent and the line height is like in the figure below π
X------------------------
/\ | |
/ \ | |
/____\ ascent |
/ \ | |
/ \ | height
---------------- |
| |
descent |
| |
-------------------------
look at that diagram. look at it. it's giving geometry class but make it fonts πβ¨
π SEE ALSO π
and that's the whole page, bestie!! ππ this was the Allegro reference manual, page al_get_font_line_height(3alleg5) β go measure some lines, you got this π«Άπ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms