| 18 | { |
| 19 | |
| 20 | FontID GetFontID(RString baseName) |
| 21 | { |
| 22 | int langID = English; |
| 23 | // Strip path prefix (some resources use "fonts\X" or "\fonts\X" instead of just "X") |
| 24 | const char* name = baseName; |
| 25 | if (name[0] == '\\' || name[0] == '/') |
| 26 | name++; |
| 27 | if (_strnicmp(name, "fonts\\", 6) == 0 || _strnicmp(name, "fonts/", 6) == 0) |
| 28 | name += 6; |
| 29 | RString lookupName = name; |
| 30 | |
| 31 | const ParamEntry* cls = (Pars >> "CfgFonts").FindEntry(GLanguage); |
| 32 | if (cls) |
| 33 | { |
| 34 | const ParamEntry* entry = cls->FindEntry(lookupName); |
| 35 | if (entry) |
| 36 | { |
| 37 | lookupName = *entry; |
| 38 | langID = Poseidon::Foundation::GetLangID(); |
| 39 | } |
| 40 | } |
| 41 | return FontID(GetDefaultName(lookupName, "fonts\\", ""), langID); |
| 42 | } |
| 43 | |
| 44 | PackedColor GetPackedColor(const ParamEntry& entry) |
| 45 | { |