diff --git a/source/common/fonts/font.cpp b/source/common/fonts/font.cpp index 98763724f..f78985b43 100644 --- a/source/common/fonts/font.cpp +++ b/source/common/fonts/font.cpp @@ -120,7 +120,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla sc.MustGetValue(false); GlobalKerning = sc.Number; } - if (sc.Compare("Altfont")) + else if (sc.Compare("Altfont")) { sc.MustGetString(); AltFontName = sc.String; @@ -179,6 +179,11 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla sc.ScriptError("Unknown translation type %s", sc.String); } } + else if (sc.Compare("lowercaselatinonly")) + { + lowercaselatinonly = true; + } + } } } @@ -755,7 +760,7 @@ int FFont::GetCharCode(int code, bool needpic) const // Use different substitution logic based on the fonts content: // In a font which has both upper and lower case, prefer unaccented small characters over capital ones. // In a pure upper-case font, do not check for lower case replacements. - if (!MixedCase) + if (!MixedCase || (lowercaselatinonly && code >= 0x380 && code < 0x500)) { // Try converting lowercase characters to uppercase. if (myislower(code)) diff --git a/source/common/fonts/v_font.h b/source/common/fonts/v_font.h index 343cbaf5d..407ee0f5e 100644 --- a/source/common/fonts/v_font.h +++ b/source/common/fonts/v_font.h @@ -167,6 +167,7 @@ public: forceremap = other.forceremap; Chars = other.Chars; Translations = other.Translations; + lowercaselatinonly = other.lowercaselatinonly; Lump = other.Lump; } @@ -189,6 +190,7 @@ protected: bool noTranslate = false; bool MixedCase = false; bool forceremap = false; + bool lowercaselatinonly = false; struct CharData { FGameTexture *OriginalPic = nullptr;