al_get_font_line_height

int al_get_font_line_height(const ALLEGRO_FONT *f)
Introduced in 5.0.0

Returns the usual height of a line of text in the specified font. For bitmap fonts this is simply the height of all glyph bitmaps. For truetype fonts it is whatever the font file specifies. In particular, some special glyphs may be higher than the height returned here.

If the X is the position you specify to draw text, the meaning of ascent and descent and the line height is like in the figure below.

X------------------------
    /\         |        |
   /  \        |        |
  /____\       ascent   |
 /      \      |        |
/        \     |        height
----------------        |
               |        |
               descent  |
               |        |
-------------------------

See also: al_get_text_width, al_get_text_dimensions

Examples: ex_bitmap_target, ex_blend, ex_blit, ex_clip, ex_display_options, ex_draw, ex_draw_bitmap, ex_font_justify, ex_fs_window, ex_logo, ex_membmp, ex_mouse_cursor, ex_native_filechooser, ex_premulalpha, ex_timer, ex_vsync, ex_warp_mouse


Most helpful discussions:

Other recent discussions: