diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2020-06-06 01:39:17 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2020-06-06 01:39:17 +0300 |
commit | b74cc23dc478f2c4260e2e4269c8450e3d5c450e (patch) | |
tree | e540058bab2816422cff19043ffb1766a804f6e8 /source/blender/blenfont/intern/blf_font.c | |
parent | fc672ce8e24e5fc62a42010dad790324f2b99a2d (diff) |
UI: Ability to Print Bold and Italics
Adds the ability to print text in bold or italics style, synthesized from a single base UI font.
Differential Revision: https://developer.blender.org/D7893
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/blenfont/intern/blf_font.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index e5e03418073..da6224cff7f 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -290,7 +290,6 @@ void blf_font_size(FontBLF *font, unsigned int size, unsigned int dpi) gc = blf_glyph_cache_find(font, size, dpi); if (gc) { - font->glyph_cache = gc; /* Optimization: do not call FT_Set_Char_Size if size did not change. */ if (font->size == size && font->dpi == dpi) { blf_glyph_cache_release(font); @@ -311,13 +310,7 @@ void blf_font_size(FontBLF *font, unsigned int size, unsigned int dpi) font->dpi = dpi; if (!gc) { - gc = blf_glyph_cache_new(font); - if (gc) { - font->glyph_cache = gc; - } - else { - font->glyph_cache = NULL; - } + blf_glyph_cache_new(font); } blf_glyph_cache_release(font); } @@ -1309,7 +1302,6 @@ void blf_font_free(FontBLF *font) BLI_spin_lock(&blf_glyph_cache_mutex); GlyphCacheBLF *gc; - font->glyph_cache = NULL; while ((gc = BLI_pophead(&font->cache))) { blf_glyph_cache_free(gc); } @@ -1356,7 +1348,6 @@ static void blf_font_fill(FontBLF *font) font->size = 0; BLI_listbase_clear(&font->cache); BLI_listbase_clear(&font->kerning_caches); - font->glyph_cache = NULL; font->kerning_cache = NULL; #if BLF_BLUR_ENABLE font->blur = 0; |