# HG changeset patch # User John Tsiombikas # Date 1345908474 -10800 # Node ID 16879398fda7b72e732b1a553c8a9082558777a9 # Parent d97cfb44221bc84af0b65e9065a2c2e23b389402 added dtx_line_height query diff -r d97cfb44221b -r 16879398fda7 src/drawtext.h --- a/src/drawtext.h Sat Aug 25 17:50:17 2012 +0300 +++ b/src/drawtext.h Sat Aug 25 18:27:54 2012 +0300 @@ -153,6 +153,7 @@ /* ---- metrics ---- */ +float dtx_line_height(void); /* rendered dimensions of a single glyph */ void dtx_glyph_box(int code, struct dtx_box *box); diff -r d97cfb44221b -r 16879398fda7 src/font.c --- a/src/font.c Sat Aug 25 17:50:17 2012 +0300 +++ b/src/font.c Sat Aug 25 18:27:54 2012 +0300 @@ -477,6 +477,13 @@ dtx_font_sz = sz; } +float dtx_line_height(void) +{ + struct dtx_glyphmap *gmap = dtx_get_font_glyphmap(dtx_font, dtx_font_sz, '\n'); + + return gmap->line_advance; +} + void dtx_glyph_box(int code, struct dtx_box *box) { int cidx;