summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-10-12 20:43:25 +0000
committerpeter1138 <peter1138@openttd.org>2014-10-12 20:43:25 +0000
commit1088ad48fceb19408f41f4f3caf0f9e525d977d9 (patch)
tree8cfd5f56b89acc4ab3a5c9be761b1015f121d79d /src/fontcache.cpp
parent771dcf3b7b15f58e1d6fb2795e7df3c00ebf2809 (diff)
downloadopenttd-1088ad48fceb19408f41f4f3caf0f9e525d977d9.tar.xz
(svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well.
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;