diff options
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 7 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 1 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_thumbs.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 132a0ec3808..5bd62980b6d 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -96,15 +96,16 @@ static FontBLF *blf_get(int fontid) return NULL; } -int BLF_init(int points, int dpi) +int BLF_init(void) { int i; for (i = 0; i < BLF_MAX_FONT; i++) global_font[i] = NULL; - global_font_points = points; - global_font_dpi = dpi; + global_font_points = 11; + global_font_dpi = 72; + return blf_font_init(); } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index aa7d539538b..bbbabfb8ba2 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -135,6 +135,7 @@ void blf_glyph_cache_clear(FontBLF *font) while ((gc = BLI_pophead(&font->cache))) { blf_glyph_cache_free(gc); } + font->glyph_cache = NULL; } void blf_glyph_cache_free(GlyphCacheBLF *gc) diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c index 133168fccf2..b6f5ffbb092 100644 --- a/source/blender/blenfont/intern/blf_thumbs.c +++ b/source/blender/blenfont/intern/blf_thumbs.c @@ -98,6 +98,10 @@ void BLF_thumb_preview( blf_font_size(font, (unsigned int)MAX2(font_size_min, font_size_curr), dpi); + /* font->glyph_cache remains NULL if blf_font_size() failed to set font size */ + if (!font->glyph_cache) + break; + /* decrease font size each time */ font_size_curr -= (font_size_curr / font_shrink); font_shrink += 1; |