summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-17 21:11:34 +0000
committerrubidium <rubidium@openttd.org>2011-11-17 21:11:34 +0000
commit881d6d25fddd6a3fabe6656cd5e3ec9029ef120a (patch)
tree4c2d0f4c1142b75354c2ec9245739c2b6482c9bd /src
parent6e31c2f068180c16c1a7ece0f166c100bf4b4616 (diff)
downloadopenttd-881d6d25fddd6a3fabe6656cd5e3ec9029ef120a.tar.xz
(svn r23242) -Codechange: allow ignoring the sprite font completely when checking whether the font supports a language
Diffstat (limited to 'src')
-rw-r--r--src/strings.cpp7
-rw-r--r--src/strings_func.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index c9af43e54..5f71f64d6 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1799,10 +1799,11 @@ static bool FindMissingGlyphs(const char **str)
* mean it might use characters that are not in the
* font, which is the whole reason this check has
* been added.
+ * @param base_font Whether to look at the base font as well.
*/
-void CheckForMissingGlyphsInLoadedLanguagePack()
+void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font)
{
- bool bad_font = FindMissingGlyphs(NULL);
+ bool bad_font = !base_font || FindMissingGlyphs(NULL);
#ifdef WITH_FREETYPE
if (bad_font) {
/* We found an unprintable character... lets try whether we can find
@@ -1814,7 +1815,7 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
memcpy(&_freetype, &backup, sizeof(backup));
- if (bad_font) {
+ if (bad_font && base_font) {
/* Our fallback font does miss characters too, so keep the
* user chosen font as that is more likely to be any good than
* the wild guess we made */
diff --git a/src/strings_func.h b/src/strings_func.h
index a52c268be..ffced1f85 100644
--- a/src/strings_func.h
+++ b/src/strings_func.h
@@ -196,6 +196,6 @@ const char *GetCurrentLanguageIsoCode();
int CDECL StringIDSorter(const StringID *a, const StringID *b);
-void CheckForMissingGlyphsInLoadedLanguagePack();
+void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font = true);
#endif /* STRINGS_FUNC_H */