summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
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);