diff options
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index d16a4d7ed4d..17799aea14d 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -41,6 +41,7 @@ #include "DNA_vec_types.h" #include "BLI_math.h" +#include "BLI_string_utf8.h" #include "BLI_threads.h" #include "BLF_api.h" @@ -188,6 +189,16 @@ int BLF_default(void) return global_font_default; } +bool BLF_has_glyph(int fontid, const char *utf8) +{ + FontBLF *font = blf_get(fontid); + if (font) { + unsigned int unicode = BLI_str_utf8_as_unicode(utf8); + return FT_Get_Char_Index(font->face, unicode) != 0; + } + return false; +} + int BLF_load(const char *name) { FontBLF *font; |