libdrawtext
changeset 13:365eba4dccec
added dtx_line_height query
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 25 Aug 2012 18:27:54 +0300 |
parents | 55c034e70809 |
children | b6ed6e9b4092 |
files | src/drawtext.h src/font.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- a/src/drawtext.h Sat Aug 25 17:50:17 2012 +0300 1.2 +++ b/src/drawtext.h Sat Aug 25 18:27:54 2012 +0300 1.3 @@ -153,6 +153,7 @@ 1.4 1.5 1.6 /* ---- metrics ---- */ 1.7 +float dtx_line_height(void); 1.8 1.9 /* rendered dimensions of a single glyph */ 1.10 void dtx_glyph_box(int code, struct dtx_box *box);
2.1 --- a/src/font.c Sat Aug 25 17:50:17 2012 +0300 2.2 +++ b/src/font.c Sat Aug 25 18:27:54 2012 +0300 2.3 @@ -477,6 +477,13 @@ 2.4 dtx_font_sz = sz; 2.5 } 2.6 2.7 +float dtx_line_height(void) 2.8 +{ 2.9 + struct dtx_glyphmap *gmap = dtx_get_font_glyphmap(dtx_font, dtx_font_sz, '\n'); 2.10 + 2.11 + return gmap->line_advance; 2.12 +} 2.13 + 2.14 void dtx_glyph_box(int code, struct dtx_box *box) 2.15 { 2.16 int cidx;