diff options
author | peter1138 <peter1138@openttd.org> | 2011-10-07 07:48:59 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2011-10-07 07:48:59 +0000 |
commit | 8a41530585402c7850ce68542ec1ea551d2cb277 (patch) | |
tree | ec6ff06bcbc14d8ca3553e8dab0340b2c2ce4866 /src/fontcache.cpp | |
parent | ca1df3ddab2c70cef9edcdc462e07fdad17f4ab9 (diff) | |
download | openttd-8a41530585402c7850ce68542ec1ea551d2cb277.tar.xz |
(svn r23009) -Change: Improve appearance of antialiased text with shadow.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r-- | src/fontcache.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 616c54a9e..8b00ab5cc 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -1045,7 +1045,7 @@ const Sprite *GetGlyph(FontSize size, WChar key) sprite.y_offs = _ascender[size] - slot->bitmap_top; /* Draw shadow for medium size */ - if (size == FS_NORMAL) { + if (size == FS_NORMAL && !aa) { for (y = 0; y < slot->bitmap.rows; y++) { for (x = 0; x < slot->bitmap.width; x++) { if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) { @@ -1074,6 +1074,12 @@ const Sprite *GetGlyph(FontSize size, WChar key) } +bool GetDrawGlyphShadow() +{ + return GetFontFace(FS_NORMAL) != NULL && GetFontAAState(FS_NORMAL); +} + + uint GetGlyphWidth(FontSize size, WChar key) { FT_Face face = GetFontFace(size); |