diff options
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r-- | src/fontcache.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 3a5dd886c..55da0c55c 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -210,6 +210,7 @@ class FreeTypeFontCache : public FontCache { private: FT_Face face; ///< The font face associated with this font. int req_size; ///< Requested font size. + int used_size; ///< Used font size. typedef SmallMap<uint32, SmallPair<size_t, const void*> > FontTable; ///< Table with font table cache FontTable font_tables; ///< Cached font tables. @@ -243,6 +244,7 @@ private: public: FreeTypeFontCache(FontSize fs, FT_Face face, int pixels); ~FreeTypeFontCache(); + virtual int GetFontSize() const { return this->used_size; } 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(); } @@ -291,6 +293,7 @@ void FreeTypeFontCache::SetFontSize(FontSize fs, FT_Face face, int pixels) pixels = Clamp(min(head->Lowest_Rec_PPEM, 20) + diff, scaled_height, MAX_FONT_SIZE); } } + this->used_size = pixels; FT_Error err = FT_Set_Pixel_Sizes(this->face, 0, pixels); if (err != FT_Err_Ok) { |