diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-04 19:09:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-04 19:09:48 +0400 |
commit | 015a32d01c4df3377eec1470827f459d43061b6d (patch) | |
tree | deecbb3fbe5fce392a693889d3c0aceaf3300596 /source/blender/blenfont/intern/blf.c | |
parent | d000103e80c076fb5bbdfbc87dc978b5e693564d (diff) |
new BLF functions
- BLF_height_max
- BLF_width_max
- BLF_descender
- BLF_ascender
use for tooltip and image stamp.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 5db71948024..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; |