summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index 45a1b28dc..c8aca9852 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -18,6 +18,7 @@
#include "strings_func.h"
#include "zoom_type.h"
#include "gfx_layout.h"
+#include "zoom_func.h"
#include "table/sprites.h"
#include "table/control_codes.h"
@@ -80,6 +81,7 @@ public:
virtual void ClearFontCache();
virtual const Sprite *GetGlyph(GlyphID key);
virtual uint GetGlyphWidth(GlyphID key);
+ virtual int GetHeight() const;
virtual bool GetDrawGlyphShadow();
virtual GlyphID MapCharToGlyph(WChar key) { assert(IsPrintable(key)); return SPRITE_GLYPH | key; }
virtual const void *GetFontTable(uint32 tag, size_t &length) { length = 0; return NULL; }
@@ -184,6 +186,11 @@ uint SpriteFontCache::GetGlyphWidth(GlyphID key)
return SpriteExists(sprite) ? GetSprite(sprite, ST_FONT)->width + (this->fs != FS_NORMAL) : 0;
}
+int SpriteFontCache::GetHeight() const
+{
+ return UnScaleByZoom(4 * this->height, ZOOM_LVL_GUI);
+}
+
bool SpriteFontCache::GetDrawGlyphShadow()
{
return false;