1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Use case-insensitive font keys, remove debug code

This commit is contained in:
Andrei Kortunov 2022-07-09 22:09:37 +04:00
parent c47a48e25d
commit 8fc3635c2c

View file

@ -219,7 +219,6 @@ namespace Gui
for (const auto& name : mVFS->getRecursiveDirectoryIterator("Fonts/")) for (const auto& name : mVFS->getRecursiveDirectoryIterator("Fonts/"))
{ {
std::filesystem::path path = name; std::filesystem::path path = name;
std::cout << name << std::endl;
if (Misc::getFileExtension(name) == "omwfont") if (Misc::getFileExtension(name) == "omwfont")
MyGUI::ResourceManager::getInstance().load(path.filename()); MyGUI::ResourceManager::getInstance().load(path.filename());
} }
@ -625,11 +624,13 @@ namespace Gui
std::string FontLoader::getInternalFontName(const std::string& name) std::string FontLoader::getInternalFontName(const std::string& name)
{ {
if (name == Settings::Manager::getString("default font", "GUI")) const std::string lowerName = Misc::StringUtils::lowerCase(name);
if (lowerName == Misc::StringUtils::lowerCase(Settings::Manager::getString("default font", "GUI")))
return "DefaultFont"; return "DefaultFont";
if (name == Settings::Manager::getString("scroll font", "GUI")) if (lowerName == Misc::StringUtils::lowerCase(Settings::Manager::getString("scroll font", "GUI")))
return "ScrollFont"; return "ScrollFont";
if (name == Settings::Manager::getString("mono font", "GUI")) if (lowerName == Misc::StringUtils::lowerCase(Settings::Manager::getString("mono font", "GUI")))
return "MonoFont"; return "MonoFont";
return name; return name;