diff options
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 3 |
2 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 637f534563f..248c645edc0 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -121,17 +121,9 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) void blf_glyph_cache_clear(FontBLF *font) { GlyphCacheBLF *gc; - GlyphBLF *g; - int i; - - for (gc = font->cache.first; gc; gc = gc->next) { - for (i = 0; i < 257; i++) { - while ((g = BLI_pophead(&gc->bucket[i]))) { - blf_glyph_free(g); - } - } - memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table)); + while ((gc = BLI_pophead(&font->cache))) { + blf_glyph_cache_free(gc); } } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f4cb4701581..7b5c269ff0d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -111,6 +111,9 @@ static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe /* also used by buffer swap switching */ static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { + /* font's are stored at each DPI level, without this we can easy load 100's of fonts */ + BLF_cache_clear(); + BKE_userdef_state(); WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */ WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */ |