diff options
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 930f55a48fa..c0e62b1c0c7 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -580,6 +580,54 @@ float BLF_height(int fontid, const char *str) return(0.0f); } +float BLF_height_max(int fontid) +{ + FontBLF *font; + + font= BLF_get(fontid); + if (font) { + if(font->glyph_cache) + return(font->glyph_cache->max_glyph_height); + } + return(0.0f); +} + +float BLF_width_max(int fontid) +{ + FontBLF *font; + + font= BLF_get(fontid); + if (font) { + if(font->glyph_cache) + return(font->glyph_cache->max_glyph_width); + } + return(0.0f); +} + +float BLF_descender(int fontid) +{ + FontBLF *font; + + font= BLF_get(fontid); + if (font) { + if(font->glyph_cache) + return(font->glyph_cache->descender); + } + return(0.0f); +} + +float BLF_ascender(int fontid) +{ + FontBLF *font; + + font= BLF_get(fontid); + if (font) { + if(font->glyph_cache) + return(font->glyph_cache->ascender); + } + return(0.0f); +} + float BLF_height_default(const char *str) { float height; @@ -657,7 +705,7 @@ void BLF_shadow_offset(int fontid, int x, int y) } } -void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch) +void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch) { FontBLF *font; |