mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 10:09:48 +00:00
Use our fonts as a fallback
This commit is contained in:
parent
1f864e3127
commit
5bc5c1bb0c
3 changed files with 9 additions and 9 deletions
|
@ -234,7 +234,7 @@ namespace MWGui
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
|
MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<AutoSizedResourceSkin>("Resource", "AutoSizedResourceSkin");
|
MyGUI::FactoryManager::getInstance().registerFactory<AutoSizedResourceSkin>("Resource", "AutoSizedResourceSkin");
|
||||||
MyGUI::ResourceManager::getInstance().load("core.xml");
|
MyGUI::ResourceManager::getInstance().load("core.xml");
|
||||||
WindowManager::loadUserFonts();
|
mFontLoader->loadTrueTypeFonts();
|
||||||
|
|
||||||
bool keyboardNav = Settings::Manager::getBool("keyboard navigation", "GUI");
|
bool keyboardNav = Settings::Manager::getBool("keyboard navigation", "GUI");
|
||||||
mKeyboardNavigation = std::make_unique<KeyboardNavigation>();
|
mKeyboardNavigation = std::make_unique<KeyboardNavigation>();
|
||||||
|
@ -290,11 +290,6 @@ namespace MWGui
|
||||||
mStatsWatcher = std::make_unique<StatsWatcher>();
|
mStatsWatcher = std::make_unique<StatsWatcher>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::loadUserFonts()
|
|
||||||
{
|
|
||||||
mFontLoader->loadTrueTypeFonts();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowManager::initUI()
|
void WindowManager::initUI()
|
||||||
{
|
{
|
||||||
// Get size info from the Gui object
|
// Get size info from the Gui object
|
||||||
|
@ -1179,7 +1174,7 @@ namespace MWGui
|
||||||
window->onResChange(x, y);
|
window->onResChange(x, y);
|
||||||
|
|
||||||
// We should reload TrueType fonts to fit new resolution
|
// 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
|
// TODO: check if any windows are now off-screen and move them back if so
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,6 @@ namespace MWGui
|
||||||
void setStore (const MWWorld::ESMStore& store);
|
void setStore (const MWWorld::ESMStore& store);
|
||||||
|
|
||||||
void initUI();
|
void initUI();
|
||||||
void loadUserFonts();
|
|
||||||
|
|
||||||
Loading::Listener* getLoadingScreen() override;
|
Loading::Listener* getLoadingScreen() override;
|
||||||
|
|
||||||
|
|
|
@ -628,9 +628,15 @@ namespace Gui
|
||||||
|
|
||||||
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_0")))
|
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_0")))
|
||||||
return "DefaultFont";
|
return "DefaultFont";
|
||||||
|
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_2")))
|
||||||
|
return "ScrollFont";
|
||||||
if (lowerName == "dejavusansmono")
|
if (lowerName == "dejavusansmono")
|
||||||
return "MonoFont"; // We need to use a TrueType monospace font to display debug texts properly.
|
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 "ScrollFont";
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|
Loading…
Reference in a new issue