MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetFontID

Function GetFontID

engine/Poseidon/IO/ParamFileExt.cpp:20–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18{
19
20FontID 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
44PackedColor GetPackedColor(const ParamEntry& entry)
45{

Callers 15

RunMainLoopMethod · 0.85
DrawMethod · 0.85
InitShapeMethod · 0.85
InitShapeMethod · 0.85
DrawMPTableMethod · 0.85
InitShapeMethod · 0.85
DrawFinishTextsMethod · 0.85
ShowTextMethod · 0.85
DrawNetworkStatisticsFunction · 0.85
LoadSoundMethod · 0.85
CWarrantMethod · 0.85

Calls 4

GetLangIDFunction · 0.85
FontIDClass · 0.85
GetDefaultNameFunction · 0.85
FindEntryMethod · 0.45

Tested by 2

TriAssertTextFitsFunction · 0.68
TriAssertCsvTextFitsFunction · 0.68