al_get_font_line_height(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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