mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-22 14:06:36 +00:00
GUI: Clean up localized font filename generation.
This commit is contained in:
parent
0ef807146e
commit
16f1b51e2a
@ -1475,20 +1475,23 @@ Common::String ThemeEngine::genLocalizedFontFilename(const Common::String &filen
|
|||||||
#ifndef USE_TRANSLATION
|
#ifndef USE_TRANSLATION
|
||||||
return filename;
|
return filename;
|
||||||
#else
|
#else
|
||||||
Common::String result;
|
// We will transform the font filename in the following way:
|
||||||
bool pointPassed = false;
|
// name.bdf
|
||||||
|
// will become:
|
||||||
|
// name-charset.bdf
|
||||||
|
// Note that name should not contain any dot here!
|
||||||
|
|
||||||
for (const char *p = filename.c_str(); *p != 0; p++) {
|
// In the first step we look for the dot. In case there is none we will
|
||||||
if (!pointPassed && *p == '.') {
|
// return the normal filename.
|
||||||
result += "-";
|
Common::String::const_iterator dot = Common::find(filename.begin(), filename.end(), '.');
|
||||||
result += TransMan.getCurrentCharset();
|
if (dot == filename.end())
|
||||||
result += *p;
|
return filename;
|
||||||
|
|
||||||
pointPassed = true;
|
// Put the translated font filename string back together.
|
||||||
} else {
|
Common::String result(filename.begin(), dot);
|
||||||
result += *p;
|
result += '-';
|
||||||
}
|
result += TransMan.getCurrentCharset();
|
||||||
}
|
result += dot;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user