diff options
author | Pavel Stupnikov <dp@dpointer.org> | 2018-04-17 20:41:31 +0300 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2018-04-17 18:41:31 +0100 |
commit | 9175c349dac23cb236aa981e93bac28a4857c19e (patch) | |
tree | 1c29c42f7072c97e0c0e8d21a3c7d9c716b90400 /src/strings.cpp | |
parent | 4d6a5fbec48d0b9967c219c6614566b5a0ef8baa (diff) | |
download | openttd-9175c349dac23cb236aa981e93bac28a4857c19e.tar.xz |
Fix #6465: Add {NORMAL_FONT} and {MONO_FONT} control codes to GS strings (#6726)
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index fd7420259..82669ddb2 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2014,10 +2014,8 @@ bool MissingGlyphSearcher::FindMissingGlyphs(const char **str) FontSize size = this->DefaultSize(); if (str != NULL) *str = text; for (WChar c = Utf8Consume(&text); c != '\0'; c = Utf8Consume(&text)) { - if (c == SCC_TINYFONT) { - size = FS_SMALL; - } else if (c == SCC_BIGFONT) { - size = FS_LARGE; + if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) { + size = (FontSize)(c - SCC_FIRST_FONT); } else if (!IsInsideMM(c, SCC_SPRITE_START, SCC_SPRITE_END) && IsPrintable(c) && !IsTextDirectionChar(c) && c != '?' && GetGlyph(size, c) == question_mark[size]) { /* The character is printable, but not in the normal font. This is the case we were testing for. */ return true; |