mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- added German Umlauts for the BigFont and fixed the character substitution logic.
For pure uppercase fonts it makes no sense to try a lowercase substitution as a first step.
This commit is contained in:
parent
3dce45545f
commit
44c8c2a79c
5 changed files with 42 additions and 13 deletions
|
@ -708,24 +708,52 @@ int FFont::GetCharCode(int code, bool needpic) const
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int originalcode = code;
|
// Use different substitution logic based on the fonts content:
|
||||||
int newcode;
|
// 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.
|
||||||
// Try stripping accents from accented characters. This may repeat to allow multi-step fallbacks.
|
if (!MixedCase)
|
||||||
while ((newcode = stripaccent(code)) != code)
|
|
||||||
{
|
{
|
||||||
code = newcode;
|
// Try converting lowercase characters to uppercase.
|
||||||
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
|
if (myislower(code))
|
||||||
{
|
{
|
||||||
return code;
|
code = upperforlower[code];
|
||||||
|
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Try stripping accents from accented characters.
|
||||||
|
int newcode = stripaccent(code);
|
||||||
|
if (newcode != code)
|
||||||
|
{
|
||||||
|
code = newcode;
|
||||||
|
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (myislower(code))
|
|
||||||
{
|
{
|
||||||
int upper = upperforlower[code];
|
int originalcode = code;
|
||||||
// Stripping accents did not help - now try uppercase for lowercase
|
int newcode;
|
||||||
if (upper != code) return GetCharCode(upper, needpic);
|
|
||||||
|
// Try stripping accents from accented characters. This may repeat to allow multi-step fallbacks.
|
||||||
|
while ((newcode = stripaccent(code)) != code)
|
||||||
|
{
|
||||||
|
code = newcode;
|
||||||
|
if (code >= FirstChar && code <= LastChar && (!needpic || Chars[code - FirstChar].TranslatedPic != nullptr))
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myislower(code))
|
||||||
|
{
|
||||||
|
int upper = upperforlower[code];
|
||||||
|
// Stripping accents did not help - now try uppercase for lowercase
|
||||||
|
if (upper != code) return GetCharCode(upper, needpic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -126,6 +126,7 @@ protected:
|
||||||
char Cursor;
|
char Cursor;
|
||||||
bool noTranslate;
|
bool noTranslate;
|
||||||
bool translateUntranslated;
|
bool translateUntranslated;
|
||||||
|
bool MixedCase = false;
|
||||||
struct CharData
|
struct CharData
|
||||||
{
|
{
|
||||||
FTexture *TranslatedPic = nullptr; // Texture for use with font translations.
|
FTexture *TranslatedPic = nullptr; // Texture for use with font translations.
|
||||||
|
|
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00C4.lmp
Normal file
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00C4.lmp
Normal file
Binary file not shown.
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00D6.lmp
Normal file
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00D6.lmp
Normal file
Binary file not shown.
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00DC.lmp
Normal file
BIN
wadsrc_extra/static/filter/game-doomchex/fonts/bigfont/00DC.lmp
Normal file
Binary file not shown.
Loading…
Reference in a new issue