| 87 | } |
| 88 | |
| 89 | IFont* FontManager::getByName(std::string_view _name) const |
| 90 | { |
| 91 | IResource* result = nullptr; |
| 92 | //FIXME для совместимости шрифт может иметь имя Default |
| 93 | if (!_name.empty() && _name != mXmlDefaultFontValue) |
| 94 | result = ResourceManager::getInstance().getByName(_name, false); |
| 95 | |
| 96 | if (result == nullptr) |
| 97 | { |
| 98 | result = ResourceManager::getInstance().getByName(mDefaultName, false); |
| 99 | if (!_name.empty() && _name != mXmlDefaultFontValue) |
| 100 | { |
| 101 | MYGUI_LOG(Error, "Font '" << _name << "' not found. Replaced with default font."); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | return result ? result->castType<IFont>(false) : nullptr; |
| 106 | } |
| 107 | |
| 108 | const std::string& FontManager::getDefaultFont() const |
| 109 | { |
no test coverage detected