summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-23 18:14:18 +0000
committerrubidium <rubidium@openttd.org>2009-02-23 18:14:18 +0000
commit85c0276d0e9cfe375100cc0a632368b4fbe310aa (patch)
tree6ac0e32a2383ad6a7f261c4100affcc0a5358bfe /src
parent3ba802e99524797571e69ba57b6a30a12b031b72 (diff)
downloadopenttd-85c0276d0e9cfe375100cc0a632368b4fbe310aa.tar.xz
(svn r15557) -Fix: the font width cache was not updated when changing fonts causing the font spacing to be off when changing fonts in-game (auto font detection).
Diffstat (limited to 'src')
-rw-r--r--src/strings.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 95342d2fb..0d421a9e5 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -30,6 +30,7 @@
#include "video/video_driver.hpp"
#include "engine_base.h"
#include "strgen/strgen.h"
+#include "gfx_func.h"
#include "table/strings.h"
#include "table/control_codes.h"
@@ -1587,6 +1588,9 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
Utf8Encode(err_str, SCC_YELLOW);
SetDParamStr(0, err_str);
ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0);
+
+ /* Reset the font width */
+ LoadStringWidthTable();
return;
}
}
@@ -1595,6 +1599,9 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
break;
}
+ /* Update the font with cache */
+ LoadStringWidthTable();
+
#if !defined(WITH_ICU)
/*
* For right-to-left languages we need the ICU library. If