diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-08-09 03:23:25 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-08-09 03:23:25 +0300 |
commit | 8b3e3c18100aac6ac956e782dc108aae500eac93 (patch) | |
tree | ce282ca9cfd692bff53d907625b25e345941571c /source/blender/blenfont/intern/blf_glyph.c | |
parent | f5fc9a7edf01c5801ddb52d6cbd6ae9ee82b1036 (diff) |
Fix T100242: Handle Flushed FT Sizes
Properly deal with FreeType cache flushing a font's ft_size. Set this
to NULL in finalizer, and add a blf_ensure_size to make sure it
exists only when needed.
See D15639 for more details.
Differential Revision: https://developer.blender.org/D15639
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 780b75c6296..3b73224152f 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -103,6 +103,7 @@ static GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) } else { /* Font does not have a face or does not contain "0" so use CSS fallback of 1/2 of em. */ + blf_ensure_size(font); gc->fixed_width = (int)((font->ft_size->metrics.height / 2) >> 6); } if (gc->fixed_width < 1) { @@ -900,6 +901,8 @@ static FT_GlyphSlot blf_glyph_render(FontBLF *settings_font, blf_font_size(glyph_font, settings_font->size, settings_font->dpi); } + blf_ensure_size(glyph_font); + /* We need to keep track if changes are still needed. */ bool weight_done = false; bool slant_done = false; |