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
This commit is contained in:
Harley Acheson 2022-08-10 20:50:49 -07:00
parent f35d671f46
commit 51381c94d8
Notes: blender-bot 2023-02-14 07:17:43 +01:00
Referenced by issue #100340, Only English fonts are displayed in 3.4 alpha
Referenced by issue #100348, UI Text Display error
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
/* -------------------------------------------------------------------- */