diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-02 03:52:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-02 03:52:53 +0300 |
commit | db4804690b84985b62941833175dd6b540d4cb0f (patch) | |
tree | b92ddc6716dcf68785539fd18caf9169cfef6c87 /source/blender/blenfont/intern/blf.c | |
parent | e7ce9b9bb82321ec6d4d5daa8105c19bd9f8f0eb (diff) |
BLF: pass code-point to BLF_has_glyph
Avoid BLF having to be concerned with decoding the string
(which can fail).
Also remove redundant extra zero byte from strings.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 17799aea14d..793e9805899 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -41,7 +41,6 @@ #include "DNA_vec_types.h" #include "BLI_math.h" -#include "BLI_string_utf8.h" #include "BLI_threads.h" #include "BLF_api.h" @@ -189,11 +188,10 @@ int BLF_default(void) return global_font_default; } -bool BLF_has_glyph(int fontid, const char *utf8) +bool BLF_has_glyph(int fontid, unsigned int unicode) { 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; |