MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getFont

Method getFont

forms/ui.cpp:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51sp<BitmapFont> UI::getFont(UString FontData)
52{
53 if (fonts.find(FontData) == fonts.end())
54 {
55 auto fontPath = UString("fonts/") + FontData + ".font";
56 LogInfo("Trying to load font \"%s\" from \"%s\"", FontData, fontPath);
57 auto font = ApocalypseFont::loadFont(fontPath);
58 if (!font)
59 {
60 LogError("Failed to find font \"%s\" at \"%s\"", FontData, fontPath);
61 return nullptr;
62 }
63 fonts[FontData] = font;
64 }
65 return fonts[FontData];
66}
67
68void UI::reloadFormsXml() { forms.clear(); }
69

Callers 15

FormPreviewMethod · 0.45
ImagePreviewMethod · 0.45
initMethod · 0.45
createLabControlMethod · 0.45
renderBaseMethod · 0.45
createMapRowBuildingMethod · 0.45
createMapRowVehicleMethod · 0.45
createMapRowBaseMethod · 0.45
AEquipScreenMethod · 0.45
MessageBoxMethod · 0.45
initResourcesMethod · 0.45
loadListMethod · 0.45

Calls 1

endMethod · 0.80

Tested by

no test coverage detected