summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fontcache.cpp9
-rw-r--r--src/fontcache.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index cf4aa0765..9e95fee64 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -75,7 +75,7 @@ public:
virtual SpriteID GetUnicodeGlyph(WChar key);
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite);
virtual void InitializeUnicodeGlyphMap();
- virtual void ClearFontCache() {}
+ virtual void ClearFontCache();
virtual const Sprite *GetGlyph(GlyphID key);
virtual uint GetGlyphWidth(GlyphID key);
virtual bool GetDrawGlyphShadow();
@@ -162,6 +162,11 @@ void SpriteFontCache::ClearGlyphToSpriteMap()
this->glyph_to_spriteid_map = NULL;
}
+void SpriteFontCache::ClearFontCache()
+{
+ Layouter::ResetFontCache(this->fs);
+}
+
const Sprite *SpriteFontCache::GetGlyph(GlyphID key)
{
SpriteID sprite = this->GetUnicodeGlyph(key);
@@ -392,6 +397,8 @@ void FreeTypeFontCache::ClearFontCache()
free(this->glyph_to_sprite);
this->glyph_to_sprite = NULL;
+
+ Layouter::ResetFontCache(this->fs);
}
FreeTypeFontCache::GlyphEntry *FreeTypeFontCache::GetGlyphPtr(GlyphID key)
diff --git a/src/fontcache.h b/src/fontcache.h
index 1f52ddcdc..646adff1a 100644
--- a/src/fontcache.h
+++ b/src/fontcache.h
@@ -159,7 +159,8 @@ static inline void InitializeUnicodeGlyphMap()
}
}
-static inline void ClearFontCache() {
+static inline void ClearFontCache()
+{
for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
FontCache::Get(fs)->ClearFontCache();
}