From ee38db6cdeeb0efc5e396201b732a31601e7b261 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 15 Jan 2016 18:38:48 +0000 Subject: [PATCH] Fix font height cache being incorrect for FreeType fonts. --- src/fontcache.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fontcache.cpp b/src/fontcache.cpp index f33a72b015..d85318fea3 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -240,7 +240,13 @@ public: ~FreeTypeFontCache(); virtual SpriteID GetUnicodeGlyph(WChar key) { return this->parent->GetUnicodeGlyph(key); } virtual void SetUnicodeGlyph(WChar key, SpriteID sprite) { this->parent->SetUnicodeGlyph(key, sprite); } - virtual void InitializeUnicodeGlyphMap() { this->parent->InitializeUnicodeGlyphMap(); } + + virtual void InitializeUnicodeGlyphMap() + { + this->parent->InitializeUnicodeGlyphMap(); + font_height_cache[this->fs] = this->GetHeight(); + } + virtual void ClearFontCache(); virtual const Sprite *GetGlyph(GlyphID key); virtual uint GetGlyphWidth(GlyphID key);