| 389 | } |
| 390 | |
| 391 | std::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 | } |
nothing calls this directly
no test coverage detected