MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / resolveFont

Method resolveFont

src/components/ThemeComponent.cpp:391–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391std::shared_ptr<Font> ThemeComponent::resolveFont(pugi::xml_node node, std::string defaultPath, unsigned int defaultSize)
392{
393 if(!node)
394 return NULL;
395
396 std::string path = expandPath(node.child("path").text().get());
397 unsigned int size = (unsigned int)(strToFloat(node.child("size").text().get()) * Renderer::getScreenHeight());
398
399 if(!boost::filesystem::exists(path))
400 {
401 path = defaultPath;
402 }
403
404 if(size == 0)
405 {
406 size = defaultSize;
407 }
408
409 return Font::get(*mWindow->getResourceManager(), path, size);
410}

Callers

nothing calls this directly

Calls 5

textMethod · 0.80
childMethod · 0.80
getResourceManagerMethod · 0.80
getScreenHeightFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected