- backport of some enhancements for Cyrillic font support for Raze.

Now the identical looking characters can be mapped to their Latin counterpart if they do not have their own glyphs.
This commit is contained in:
Christoph Oelckers 2020-10-04 08:11:27 +02:00
parent ffb4c52c96
commit f9ee465741
3 changed files with 21 additions and 3 deletions

View file

@ -1150,3 +1150,4 @@ CCMD (pullin)
Printf (TEXTCOLOR_BOLD "Pullin" TEXTCOLOR_NORMAL " is only valid from .cfg\n"
"files and only when used at startup.\n");
}

View file

@ -880,6 +880,8 @@ int FFont::GetColorTranslation (EColorRange range, PalEntry *color) const
int FFont::GetCharCode(int code, bool needpic) const
{
int newcode;
if (code < 0 && code >= -128)
{
// regular chars turn negative when the 8th bit is set.
@ -905,8 +907,7 @@ int FFont::GetCharCode(int code, bool needpic) const
}
}
// Try stripping accents from accented characters.
int newcode = stripaccent(code);
if (newcode != code)
while ((newcode = stripaccent(code)) != code)
{
code = newcode;
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
@ -918,7 +919,6 @@ int FFont::GetCharCode(int code, bool needpic) const
else
{
int originalcode = code;
int newcode;
// Try stripping accents from accented characters. This may repeat to allow multi-step fallbacks.
while ((newcode = stripaccent(code)) != code)

View file

@ -402,6 +402,23 @@ int getAlternative(int code)
case 0x406: return 'I';
case 0x407: return 0xcf;
case 0x408: return 'J';
case 0x410: return 'A';
case 0x412: return 'B';
case 0x415: return 'E';
case 0x41a: return 'K';
case 0x41c: return 'M';
case 0x41d: return 'H';
case 0x41e: return 'O';
case 0x420: return 'P';
case 0x421: return 'C';
case 0x423: return 'T';
case 0x425: return 'X';
case 0x430: return 'a';
case 0x435: return 'e';
case 0x43e: return 'o';
case 0x440: return 'p';
case 0x441: return 'c';
case 0x445: return 'x';
case 0x450: return 0xe8;
case 0x451: return 0xeb;
case 0x455: return 's';