From 51381c94d8e046c78ccba190bff137cc9f11dcef Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Wed, 10 Aug 2022 20:50:49 -0700 Subject: BLF: Fallback Broken After Cache Removal Font fallback feature not working after reverting the implementation of the cache system. Missing an blf_ensure_face before FT_Get_Char_Index. Otherwise glyphs not found in fonts without faces. Own Code --- source/blender/blenfont/intern/blf_font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 5f904d86b03..b958f3c2336 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -70,7 +70,7 @@ static ft_pix blf_font_width_max_ft_pix(struct FontBLF *font); /* Return glyph id from charcode. */ uint blf_get_char_index(struct FontBLF *font, uint charcode) { - return FT_Get_Char_Index(font->face, charcode); + return blf_ensure_face(font) ? FT_Get_Char_Index(font->face, charcode) : 0; } /* -------------------------------------------------------------------- */ -- cgit v1.2.3