summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-10 12:56:37 +0000
committerrubidium <rubidium@openttd.org>2011-12-10 12:56:37 +0000
commitebb3ad33ffdb950edf159d5bbcf14b56191ac0b2 (patch)
tree8461988317bdc3430e3cc3b9c3f33f707cb9d76a /src/gfx.cpp
parent6cbeb9e745c9eb3f0b5b768fdb9ed81a98b8fb02 (diff)
downloadopenttd-ebb3ad33ffdb950edf159d5bbcf14b56191ac0b2.tar.xz
(svn r23472) -Fix [FS#4877]: the monospace font broke the bootstrap GUI's ability to find a font
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index fbca165af..61fc5ea33 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1516,13 +1516,16 @@ void DoPaletteAnimations()
}
-/** Initialize _stringwidth_table cache */
-void LoadStringWidthTable()
+/**
+ * Initialize _stringwidth_table cache
+ * @param monospace Whether to load the monospace cache or the normal fonts.
+ */
+void LoadStringWidthTable(bool monospace)
{
_max_char_height = 0;
_max_char_width = 0;
- for (FontSize fs = FS_BEGIN; fs < FS_END; fs++) {
+ for (FontSize fs = monospace ? FS_MONO : FS_BEGIN; fs < (monospace ? FS_END : FS_MONO); fs++) {
_max_char_height = max<int>(_max_char_height, GetCharacterHeight(fs));
for (uint i = 0; i != 224; i++) {
_stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32);