1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 06:39:43 +00:00

Use our fonts as a fallback

This commit is contained in:
Andrei Kortunov 2022-07-18 09:57:20 +04:00
parent 1f864e3127
commit 5bc5c1bb0c
3 changed files with 9 additions and 9 deletions

View file

@ -234,7 +234,7 @@ namespace MWGui
MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
MyGUI::FactoryManager::getInstance().registerFactory<AutoSizedResourceSkin>("Resource", "AutoSizedResourceSkin");
MyGUI::ResourceManager::getInstance().load("core.xml");
WindowManager::loadUserFonts();
mFontLoader->loadTrueTypeFonts();
bool keyboardNav = Settings::Manager::getBool("keyboard navigation", "GUI");
mKeyboardNavigation = std::make_unique<KeyboardNavigation>();
@ -290,11 +290,6 @@ namespace MWGui
mStatsWatcher = std::make_unique<StatsWatcher>();
}
void WindowManager::loadUserFonts()
{
mFontLoader->loadTrueTypeFonts();
}
void WindowManager::initUI()
{
// Get size info from the Gui object
@ -1179,7 +1174,7 @@ namespace MWGui
window->onResChange(x, y);
// We should reload TrueType fonts to fit new resolution
loadUserFonts();
mFontLoader->loadTrueTypeFonts();
// TODO: check if any windows are now off-screen and move them back if so
}

View file

@ -143,7 +143,6 @@ namespace MWGui
void setStore (const MWWorld::ESMStore& store);
void initUI();
void loadUserFonts();
Loading::Listener* getLoadingScreen() override;

View file

@ -628,9 +628,15 @@ namespace Gui
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_0")))
return "DefaultFont";
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_2")))
return "ScrollFont";
if (lowerName == "dejavusansmono")
return "MonoFont"; // We need to use a TrueType monospace font to display debug texts properly.
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_2")))
// Use our TrueType fonts as a fallback.
if (!MyGUI::ResourceManager::getInstance().isExist("DefaultFont") && name == "pelagiad")
return "DefaultFont";
if (!MyGUI::ResourceManager::getInstance().isExist("ScrollFont") && name == "ayembedt")
return "ScrollFont";
return name;