diff --git a/README.md b/README.md index b1ea6cbde3..e19ea468e1 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ OpenMW also comes with OpenMW-CS, a replacement for Bethesda's Construction Set. Font Licenses: * DejaVuLGCSansMono.ttf: custom (see [files/data/fonts/DejaVuFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/DejaVuFontLicense.txt) for more information) -* OMWAyembedt.ttf: SIL Open Font License (see [files/data/fonts/OMWAyembedtFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/OMWAyembedtFontLicense.txt) for more information) -* Pelagiad.ttf: SIL Open Font License (see [files/data/fonts/PelagiadFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/PelagiadFontLicense.txt) for more information) +* DemonicLetters.ttf: SIL Open Font License (see [files/data/fonts/DemonicLettersFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/DemonicLettersFontLicense.txt) for more information) +* MysticCards.ttf: SIL Open Font License (see [files/data/fonts/MysticCardsFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/MysticCardsFontLicense.txt) for more information) Current Status -------------- diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index 51695654ba..e6dd74dbd7 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -205,7 +205,6 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(graphicHerbalismCheckBox, "graphic herbalism", "Game"); scalingSpinBox->setValue(Settings::Manager::getFloat("scaling factor", "GUI")); fontSizeSpinBox->setValue(Settings::Manager::getInt("font size", "GUI")); - ttfResolutionSpinBox->setValue(Settings::Manager::getInt("ttf resolution", "GUI")); } // Bug fixes @@ -373,10 +372,6 @@ void Launcher::AdvancedPage::saveSettings() int fontSize = fontSizeSpinBox->value(); if (fontSize != Settings::Manager::getInt("font size", "GUI")) Settings::Manager::setInt("font size", "GUI", fontSize); - - int ttfResolution = ttfResolutionSpinBox->value(); - if (ttfResolution != Settings::Manager::getInt("ttf resolution", "GUI")) - Settings::Manager::setInt("ttf resolution", "GUI", ttfResolution); } // Bug fixes diff --git a/apps/openmw/mwgui/debugwindow.cpp b/apps/openmw/mwgui/debugwindow.cpp index f4a4814654..93f5fdb076 100644 --- a/apps/openmw/mwgui/debugwindow.cpp +++ b/apps/openmw/mwgui/debugwindow.cpp @@ -92,14 +92,14 @@ namespace MWGui // - Shader editor MyGUI::TabItem* itemLV = mTabControl->addItem("Log Viewer"); - itemLV->setCaptionWithReplacing("#{DebugMenu:LogViewer}"); + itemLV->setCaptionWithReplacing(" #{DebugMenu:LogViewer} "); mLogView = itemLV->createWidgetReal ("LogEdit", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Stretch); mLogView->setEditReadOnly(true); #ifndef BT_NO_PROFILE MyGUI::TabItem* item = mTabControl->addItem("Physics Profiler"); - item->setCaptionWithReplacing("#{DebugMenu:PhysicsProfiler}"); + item->setCaptionWithReplacing(" #{DebugMenu:PhysicsProfiler} "); mBulletProfilerEdit = item->createWidgetReal ("LogEdit", MyGUI::FloatCoord(0,0,1,1), MyGUI::Align::Stretch); #else diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 1e740abe22..5fa144d254 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -25,6 +26,7 @@ #include "bookpage.hpp" #include "textcolours.hpp" +#include "tooltips.hpp" #include "journalbooks.hpp" // to_utf8_span @@ -59,6 +61,8 @@ namespace MWGui PersuasionDialog::PersuasionDialog(ResponseCallback* callback) : WindowModal("openmw_persuasion_dialog.layout") , mCallback(callback) + , mInitialGoldLabelWidth(0) + , mInitialMainWidgetWidth(0) { getWidget(mCancelButton, "CancelButton"); getWidget(mAdmireButton, "AdmireButton"); @@ -68,6 +72,26 @@ namespace MWGui getWidget(mBribe100Button, "Bribe100Button"); getWidget(mBribe1000Button, "Bribe1000Button"); getWidget(mGoldLabel, "GoldLabel"); + getWidget(mActionsBox, "ActionsBox"); + + int totalHeight = 3; + adjustAction(mAdmireButton, totalHeight); + adjustAction(mIntimidateButton, totalHeight); + adjustAction(mTauntButton, totalHeight); + adjustAction(mBribe10Button, totalHeight); + adjustAction(mBribe100Button, totalHeight); + adjustAction(mBribe1000Button, totalHeight); + totalHeight += 3; + + int diff = totalHeight - mActionsBox->getSize().height; + if (diff > 0) + { + auto mainWidgetSize = mMainWidget->getSize(); + mMainWidget->setSize(mainWidgetSize.width, mainWidgetSize.height + diff); + } + + mInitialGoldLabelWidth = mActionsBox->getSize().width - mCancelButton->getSize().width - 8; + mInitialMainWidgetWidth = mMainWidget->getSize().width; mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PersuasionDialog::onCancel); mAdmireButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PersuasionDialog::onPersuade); @@ -78,6 +102,14 @@ namespace MWGui mBribe1000Button->eventMouseButtonClick += MyGUI::newDelegate(this, &PersuasionDialog::onPersuade); } + void PersuasionDialog::adjustAction(MyGUI::Widget* action, int& totalHeight) + { + const int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2; + auto currentCoords = action->getCoord(); + action->setCoord(currentCoords.left, totalHeight, currentCoords.width, lineHeight); + totalHeight += lineHeight; + } + void PersuasionDialog::onCancel(MyGUI::Widget *sender) { setVisible(false); @@ -114,6 +146,13 @@ namespace MWGui mBribe1000Button->setEnabled (playerGold >= 1000); mGoldLabel->setCaptionWithReplacing("#{sGold}: " + MyGUI::utility::toString(playerGold)); + + int diff = mGoldLabel->getRequestedSize().width - mInitialGoldLabelWidth; + if (diff > 0) + mMainWidget->setSize(mInitialMainWidgetWidth + diff, mMainWidget->getSize().height); + else + mMainWidget->setSize(mInitialMainWidgetWidth, mMainWidget->getSize().height); + WindowModal::onOpen(); } diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp index aff09c0211..f2bf961e5e 100644 --- a/apps/openmw/mwgui/dialogue.hpp +++ b/apps/openmw/mwgui/dialogue.hpp @@ -12,6 +12,7 @@ namespace Gui { + class AutoSizedTextBox; class MWList; } @@ -31,6 +32,9 @@ namespace MWGui private: std::unique_ptr mCallback; + int mInitialGoldLabelWidth; + int mInitialMainWidgetWidth; + MyGUI::Button* mCancelButton; MyGUI::Button* mAdmireButton; MyGUI::Button* mIntimidateButton; @@ -38,7 +42,10 @@ namespace MWGui MyGUI::Button* mBribe10Button; MyGUI::Button* mBribe100Button; MyGUI::Button* mBribe1000Button; - MyGUI::TextBox* mGoldLabel; + MyGUI::Widget* mActionsBox; + Gui::AutoSizedTextBox* mGoldLabel; + + void adjustAction(MyGUI::Widget* action, int& totalHeight); void onCancel (MyGUI::Widget* sender); void onPersuade (MyGUI::Widget* sender); diff --git a/apps/openmw/mwgui/itemwidget.cpp b/apps/openmw/mwgui/itemwidget.cpp index 3f0ac39693..a5658cb5d9 100644 --- a/apps/openmw/mwgui/itemwidget.cpp +++ b/apps/openmw/mwgui/itemwidget.cpp @@ -25,14 +25,29 @@ namespace if (count == 1) return ""; + // With small text size we can use up to 4 characters, while with large ones - only up to 3. + if (fontHeight > 16) + { + if (count > 999999999) + return MyGUI::utility::toString(count/1000000000) + "b"; + else if (count > 9999999) + return ">9m"; + else if (count > 999999) + return MyGUI::utility::toString(count/1000000) + "m"; + else if (count > 9999) + return ">9k"; + else if (count > 999) + return MyGUI::utility::toString(count/1000) + "k"; + else + return MyGUI::utility::toString(count); + } + if (count > 999999999) return MyGUI::utility::toString(count/1000000000) + "b"; else if (count > 999999) return MyGUI::utility::toString(count/1000000) + "m"; else if (count > 9999) return MyGUI::utility::toString(count/1000) + "k"; - else if (fontHeight >= 18 && count > 999) - return MyGUI::utility::toString(count/1000) + "k"; else return MyGUI::utility::toString(count); } diff --git a/apps/openmw/mwgui/trainingwindow.cpp b/apps/openmw/mwgui/trainingwindow.cpp index 96267cc7b2..24a4eb3607 100644 --- a/apps/openmw/mwgui/trainingwindow.cpp +++ b/apps/openmw/mwgui/trainingwindow.cpp @@ -98,6 +98,8 @@ namespace MWGui const MWWorld::Store &gmst = MWBase::Environment::get().getWorld()->getStore().get(); + const int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2; + for (int i=0; i<3; ++i) { int price = static_cast(pcStats.getSkill (skills[i].first).getBase() * gmst.find("iTrainingMod")->mValue.getInteger()); @@ -105,7 +107,7 @@ namespace MWGui price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, price, true); MyGUI::Button* button = mTrainingOptions->createWidget(price <= playerGold ? "SandTextButton" : "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip - MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default); + MyGUI::IntCoord(5, 5+i*lineHeight, mTrainingOptions->getWidth()-10, lineHeight), MyGUI::Align::Default); button->setUserData(skills[i].first); button->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onTrainingSelected); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index ac9b83eaba..b78276b259 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -207,7 +207,6 @@ namespace MWGui // Load fonts mFontLoader = std::make_unique(encoding, resourceSystem->getVFS(), mScalingFactor); - mFontLoader->loadFonts(); //Register own widgets with MyGUI MyGUI::FactoryManager::getInstance().registerFactory("Widget"); diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index fd415a20f3..c4fb3e4e18 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -25,11 +25,52 @@ #include #include +#include #include namespace { + MyGUI::xml::ElementPtr getProperty(MyGUI::xml::ElementPtr resourceNode, const std::string propertyName) + { + MyGUI::xml::ElementPtr propertyNode = nullptr; + MyGUI::xml::ElementEnumerator propertyIterator = resourceNode->getElementEnumerator(); + while (propertyIterator.next("Property")) + { + std::string key = propertyIterator->findAttribute("key"); + + if (key == propertyName) + { + propertyNode = propertyIterator.current(); + break; + } + } + + return propertyNode; + } + + MyGUI::IntSize getBookSize(MyGUI::IDataStream* layersStream) + { + MyGUI::xml::Document xmlDocument; + xmlDocument.open(layersStream); + MyGUI::xml::ElementPtr root = xmlDocument.getRoot(); + MyGUI::xml::ElementEnumerator layersIterator = root->getElementEnumerator(); + while (layersIterator.next("Layer")) + { + std::string name = layersIterator->findAttribute("name"); + + if (name == "JournalBooks") + { + MyGUI::xml::ElementPtr sizeProperty = getProperty(layersIterator.current(), "Size"); + const std::string& sizeValue = sizeProperty != nullptr ? sizeProperty->findAttribute("value") : std::string(); + if (!sizeValue.empty()) + return MyGUI::IntSize::parse(sizeValue); + } + } + + return MyGUI::RenderManager::getInstance().getViewSize(); + } + unsigned long utf8ToUnicode(std::string_view utf8) { if (utf8.empty()) @@ -155,7 +196,7 @@ namespace Gui FontLoader::FontLoader(ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor) : mVFS(vfs) - , mFontHeight(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 20)) + , mFontHeight(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 18)) , mScalingFactor(scalingFactor) { if (encoding == ToUTF8::WINDOWS_1252) @@ -165,6 +206,8 @@ namespace Gui MyGUI::ResourceManager::getInstance().unregisterLoadXmlDelegate("Resource"); MyGUI::ResourceManager::getInstance().registerLoadXmlDelegate("Resource") = MyGUI::newDelegate(this, &FontLoader::overrideLineHeight); + + loadFonts(); } void FontLoader::loadFonts() @@ -176,10 +219,10 @@ namespace Gui loadFont("DejaVuLGCSansMono", "MonoFont"); // We need to use a TrueType monospace font to display debug texts properly. // Use our TrueType fonts as a fallback. - if (!MyGUI::ResourceManager::getInstance().isExist("DefaultFont") && !Misc::StringUtils::ciEqual(defaultFont, "Pelagiad")) - loadFont("Pelagiad", "DefaultFont"); - if (!MyGUI::ResourceManager::getInstance().isExist("ScrollFont") && !Misc::StringUtils::ciEqual(scrollFont, "OMWAyembedt")) - loadFont("OMWAyembedt", "ScrollFont"); + if (!MyGUI::ResourceManager::getInstance().isExist("DefaultFont") && !Misc::StringUtils::ciEqual(defaultFont, "MysticCards")) + loadFont("MysticCards", "DefaultFont"); + if (!MyGUI::ResourceManager::getInstance().isExist("ScrollFont") && !Misc::StringUtils::ciEqual(scrollFont, "DemonicLetters")) + loadFont("DemonicLetters", "ScrollFont"); } void FontLoader::loadFont(const std::string& fileName, const std::string& fontId) @@ -203,6 +246,11 @@ namespace Gui return; } + // TODO: it may be worth to take in account resolution change, but it is not safe to replace used assets + std::unique_ptr layersStream(dataManager->getData("openmw_layers.xml")); + MyGUI::IntSize bookSize = getBookSize(layersStream.get()); + float bookScale = osgMyGUI::ScalingLayer::getScaleFactor(bookSize); + std::string oldDataPath = dataManager->getDataPath(""); dataManager->setResourcePath("fonts"); std::unique_ptr dataStream(dataManager->getData(fileName)); @@ -226,15 +274,17 @@ namespace Gui return; } - // For TrueType fonts we should override Size and Resolution properties - // to allow to configure font size via config file, without need to edit XML files. - // Also we should take UI scaling factor in account. - int resolution = Settings::Manager::getInt("ttf resolution", "GUI"); - resolution = std::clamp(resolution, 50, 125) * mScalingFactor; + int resolution = 70; + MyGUI::xml::ElementPtr resolutionNode = getProperty(resourceNode.current(), "Resolution"); + if (resolutionNode == nullptr) + { + resolutionNode = resourceNode->createChild("Property"); + resolutionNode->addAttribute("key", "Resolution"); + } + else + resolution = MyGUI::utility::parseInt(resolutionNode->findAttribute("value")); - MyGUI::xml::ElementPtr resolutionNode = resourceNode->createChild("Property"); - resolutionNode->addAttribute("key", "Resolution"); - resolutionNode->addAttribute("value", std::to_string(resolution)); + resolutionNode->setAttribute("value", MyGUI::utility::toString(resolution * std::ceil(mScalingFactor))); MyGUI::xml::ElementPtr sizeNode = resourceNode->createChild("Property"); sizeNode->addAttribute("key", "Size"); @@ -246,16 +296,7 @@ namespace Gui font->setResourceName(fontId); MyGUI::ResourceManager::getInstance().addResource(font); - float currentX = Settings::Manager::getInt("resolution x", "Video"); - float currentY = Settings::Manager::getInt("resolution y", "Video"); - // TODO: read size from openmw_layout.xml somehow - // TODO: it may be worth to take in account resolution change, but it is not safe to replace used assets - float heightScale = (currentY / 520); - float widthScale = (currentX / 600); - float uiScale = std::min(widthScale, heightScale); - resolution = Settings::Manager::getInt("ttf resolution", "GUI"); - resolution = std::clamp(resolution, 50, 125) * uiScale; - resolutionNode->setAttribute("value", std::to_string(resolution)); + resolutionNode->setAttribute("value", MyGUI::utility::toString(static_cast(resolution * bookScale * mScalingFactor))); MyGUI::ResourceTrueTypeFont* bookFont = static_cast( MyGUI::FactoryManager::getInstance().createObject("Resource", "ResourceTrueTypeFont")); @@ -553,12 +594,9 @@ namespace Gui std::string FontLoader::getFontForFace(const std::string& face) { const std::string lowerFace = Misc::StringUtils::lowerCase(face); - - if (lowerFace == "magic cards") - return "DefaultFont"; if (lowerFace == "daedric") return "ScrollFont"; - return face; + return "DefaultFont"; } } diff --git a/components/fontloader/fontloader.hpp b/components/fontloader/fontloader.hpp index 3a2151787b..abc0b22bc6 100644 --- a/components/fontloader/fontloader.hpp +++ b/components/fontloader/fontloader.hpp @@ -27,8 +27,6 @@ namespace Gui public: FontLoader (ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor); - void loadFonts(); - void overrideLineHeight(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version); int getFontHeight(); @@ -41,6 +39,7 @@ namespace Gui int mFontHeight; float mScalingFactor; + void loadFonts(); void loadFont(const std::string& fontName, const std::string& fontId); void loadBitmapFont (const std::string& fileName, const std::string& fontId); diff --git a/components/myguiplatform/scalinglayer.cpp b/components/myguiplatform/scalinglayer.cpp index 75a149c810..e0ab25819c 100644 --- a/components/myguiplatform/scalinglayer.cpp +++ b/components/myguiplatform/scalinglayer.cpp @@ -63,7 +63,7 @@ namespace osgMyGUI void ScalingLayer::screenToLayerCoords(int& _left, int& _top) const { - float scale = getScaleFactor(); + float scale = getScaleFactor(mViewSize); if (scale <= 0.f) return; @@ -79,14 +79,14 @@ namespace osgMyGUI _top += mViewSize.height/2; } - float ScalingLayer::getScaleFactor() const + float ScalingLayer::getScaleFactor(const MyGUI::IntSize& _layerViewSize) { MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize(); float w = static_cast(viewSize.width); float h = static_cast(viewSize.height); - float heightScale = (h / mViewSize.height); - float widthScale = (w / mViewSize.width); + float heightScale = (h / _layerViewSize.height); + float widthScale = (w / _layerViewSize.width); return std::min(widthScale, heightScale); } @@ -100,12 +100,12 @@ namespace osgMyGUI { MyGUI::IntSize globalViewSize = MyGUI::RenderManager::getInstance().getViewSize(); MyGUI::IntSize viewSize = globalViewSize; - float scale = getScaleFactor(); + float scale = getScaleFactor(mViewSize); viewSize.width = static_cast(viewSize.width / scale); viewSize.height = static_cast(viewSize.height / scale); - float hoffset = (globalViewSize.width - mViewSize.width*getScaleFactor())/2.f / static_cast(globalViewSize.width); - float voffset = (globalViewSize.height - mViewSize.height*getScaleFactor())/2.f / static_cast(globalViewSize.height); + float hoffset = (globalViewSize.width - mViewSize.width*getScaleFactor(mViewSize))/2.f / static_cast(globalViewSize.width); + float voffset = (globalViewSize.height - mViewSize.height*getScaleFactor(mViewSize))/2.f / static_cast(globalViewSize.height); ProxyRenderTarget proxy(_target, viewSize, hoffset, voffset); diff --git a/components/myguiplatform/scalinglayer.hpp b/components/myguiplatform/scalinglayer.hpp index f9fd92a784..805edb0d01 100644 --- a/components/myguiplatform/scalinglayer.hpp +++ b/components/myguiplatform/scalinglayer.hpp @@ -21,9 +21,10 @@ namespace osgMyGUI void resizeView(const MyGUI::IntSize& _viewSize) override; + static float getScaleFactor(const MyGUI::IntSize& _layerViewSize); + private: void screenToLayerCoords(int& _left, int& _top) const; - float getScaleFactor() const; }; } diff --git a/components/widgets/fontwrapper.hpp b/components/widgets/fontwrapper.hpp index 16ebba3587..b4150a725a 100644 --- a/components/widgets/fontwrapper.hpp +++ b/components/widgets/fontwrapper.hpp @@ -35,7 +35,7 @@ namespace Gui std::string getFontSize() { // Note: we can not use the FontLoader here, so there is a code duplication a bit. - static const std::string fontSize = std::to_string(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 20)); + static const std::string fontSize = std::to_string(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 18)); return fontSize; } }; diff --git a/docs/source/reference/modding/font.rst b/docs/source/reference/modding/font.rst index 8b3be358e6..ae2a457e44 100644 --- a/docs/source/reference/modding/font.rst +++ b/docs/source/reference/modding/font.rst @@ -3,8 +3,8 @@ Fonts Default UI font and font used in magic scrolls are defined in ``openmw.cfg``: - fallback=Fonts_Font_0,Pelagiad - fallback=Fonts_Font_2,OMWAyembedt + fallback=Fonts_Font_0,MysticCards + fallback=Fonts_Font_2,DemonicLetters When there are no ``Fonts_Font_*`` lines in user's ``openmw.cfg``, built-in TrueType fonts are used. Font used by console and another debug windows is not configurable (so ``Fonts_Font_1`` is unused). @@ -30,23 +30,22 @@ TrueType fonts -------------- Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts. This is the recommended fonts format. -OpenMW has build-in TrueType fonts: Pelagiad, OMWAyembedt and DejaVuLGCSansMono, which are used by default. +OpenMW has build-in TrueType fonts: MysticCards, DemonicLetters and DejaVuLGCSansMono, which are used by default. TrueType fonts are configured via ``openmw.cfg`` too: - fallback=Fonts_Font_0,Pelagiad - fallback=Fonts_Font_2,OMWAyembedt + fallback=Fonts_Font_0,MysticCards + fallback=Fonts_Font_2,DemonicLetters In this example, OpenMW will scan ``Fonts`` folder in data directories for ``.omwfont`` files. These files are XML files with schema provided by MyGUI. OpenMW uses ``.omwfont`` files which name (without extension) matches ``openmw.cfg`` entries. -It is also possible to adjust the font size and resolution via ``settings.cfg`` file:: +It is also possible to adjust the font size via ``settings.cfg`` file:: [GUI] font size = 16 - ttf resolution = 75 -The ``font size`` setting accepts clamped values in range from 12 to 20 while ``ttf resolution`` setting accepts values from 50 to 125. +The ``font size`` setting accepts clamped values in range from 12 to 18. -Any Resolution or Size properties in the ``.omwfont`` file have no effect because the engine settings override them. +Any Size property in the ``.omwfont`` file has no effect because the engine overrides it. The engine automatically takes UI scaling factor into account, so don't account for it when tweaking the settings. diff --git a/docs/source/reference/modding/settings/GUI.rst b/docs/source/reference/modding/settings/GUI.rst index 08f3fbd830..d9ab6af197 100644 --- a/docs/source/reference/modding/settings/GUI.rst +++ b/docs/source/reference/modding/settings/GUI.rst @@ -17,7 +17,7 @@ font size --------- :Type: integer -:Range: 12 to 20 +:Range: 12 to 18 :Default: 16 Allows to specify glyph size for in-game fonts. @@ -26,18 +26,6 @@ TrueType fonts do not have this issue. This setting can be configured in the Interface section of Advanced tab of the launcher. -ttf resolution --------------- - -:Type: integer -:Range: 50 to 125 -:Default: 75 - -Allows to specify resolution for in-game TrueType fonts. -Note: actual resolution depends on "scaling factor" setting value, this value is for 1.0 scaling factor. - -This setting can be configured in the Interface section of Advanced tab of the launcher. - menu transparency ----------------- diff --git a/files/data/CMakeLists.txt b/files/data/CMakeLists.txt index 6186759102..2630fbed84 100644 --- a/files/data/CMakeLists.txt +++ b/files/data/CMakeLists.txt @@ -13,12 +13,12 @@ set(BUILTIN_DATA_FILES fonts/DejaVuFontLicense.txt fonts/DejaVuLGCSansMono.ttf fonts/DejaVuLGCSansMono.omwfont - fonts/OMWAyembedt.ttf - fonts/OMWAyembedt.omwfont - fonts/OMWAyembedtFontLicense.txt - fonts/Pelagiad.ttf - fonts/Pelagiad.omwfont - fonts/PelagiadFontLicense.txt + fonts/DemonicLetters.ttf + fonts/DemonicLetters.omwfont + fonts/DemonicLettersFontLicense.txt + fonts/MysticCards.ttf + fonts/MysticCards.omwfont + fonts/MysticCardsFontLicense.txt l10n/BuiltInShaders/de.yaml l10n/BuiltInShaders/en.yaml diff --git a/files/data/fonts/DejaVuLGCSansMono.omwfont b/files/data/fonts/DejaVuLGCSansMono.omwfont index 5e6726c2fb..0d5a115c18 100644 --- a/files/data/fonts/DejaVuLGCSansMono.omwfont +++ b/files/data/fonts/DejaVuLGCSansMono.omwfont @@ -4,6 +4,7 @@ + diff --git a/files/data/fonts/OMWAyembedt.omwfont b/files/data/fonts/DemonicLetters.omwfont similarity index 52% rename from files/data/fonts/OMWAyembedt.omwfont rename to files/data/fonts/DemonicLetters.omwfont index 5abf514e24..adbf7bd7b5 100644 --- a/files/data/fonts/OMWAyembedt.omwfont +++ b/files/data/fonts/DemonicLetters.omwfont @@ -1,11 +1,15 @@ - + + + - + + + diff --git a/files/data/fonts/DemonicLetters.ttf b/files/data/fonts/DemonicLetters.ttf new file mode 100644 index 0000000000..33b5fc7c2d Binary files /dev/null and b/files/data/fonts/DemonicLetters.ttf differ diff --git a/files/data/fonts/OMWAyembedtFontLicense.txt b/files/data/fonts/DemonicLettersFontLicense.txt similarity index 97% rename from files/data/fonts/OMWAyembedtFontLicense.txt rename to files/data/fonts/DemonicLettersFontLicense.txt index 47986d5463..11f50143cf 100644 --- a/files/data/fonts/OMWAyembedtFontLicense.txt +++ b/files/data/fonts/DemonicLettersFontLicense.txt @@ -1,3 +1,6 @@ +Copyright (c) 2022, OpenMW Team (https://gitlab.com/OpenMW), +with Reserved Font Name "DemonicLetters.ttf". + Copyright (c) 2014, Georg Duffner (https://github.com/georgd/OpenMW-Fonts), with Reserved Font Name "OMWAyembedt.ttf". diff --git a/files/data/fonts/Pelagiad.omwfont b/files/data/fonts/MysticCards.omwfont similarity index 69% rename from files/data/fonts/Pelagiad.omwfont rename to files/data/fonts/MysticCards.omwfont index 2fe2bcf942..1297c981df 100644 --- a/files/data/fonts/Pelagiad.omwfont +++ b/files/data/fonts/MysticCards.omwfont @@ -1,42 +1,43 @@ - + + + - + + - + + - + + - + + - - - - + - - diff --git a/files/data/fonts/MysticCards.ttf b/files/data/fonts/MysticCards.ttf new file mode 100644 index 0000000000..c6e7401e1f Binary files /dev/null and b/files/data/fonts/MysticCards.ttf differ diff --git a/files/data/fonts/PelagiadFontLicense.txt b/files/data/fonts/MysticCardsFontLicense.txt similarity index 97% rename from files/data/fonts/PelagiadFontLicense.txt rename to files/data/fonts/MysticCardsFontLicense.txt index 2d4aff5cdd..7d73af5dec 100644 --- a/files/data/fonts/PelagiadFontLicense.txt +++ b/files/data/fonts/MysticCardsFontLicense.txt @@ -1,3 +1,6 @@ +Copyright (c) 2022, OpenMW Team (https://gitlab.com/OpenMW), +with Reserved Font Name "MysticCards.ttf". + Copyright (c) 2015, Isak Larborn (isaskar.github.io/Pelagiad|Isaskar@users.noreply.github.com), with Reserved Font Name "Pelagiad.ttf". diff --git a/files/data/fonts/OMWAyembedt.ttf b/files/data/fonts/OMWAyembedt.ttf deleted file mode 100644 index fb889b17fc..0000000000 Binary files a/files/data/fonts/OMWAyembedt.ttf and /dev/null differ diff --git a/files/data/fonts/Pelagiad.ttf b/files/data/fonts/Pelagiad.ttf deleted file mode 100644 index 07653b0530..0000000000 Binary files a/files/data/fonts/Pelagiad.ttf and /dev/null differ diff --git a/files/data/l10n/SettingsMenu/ru.yaml b/files/data/l10n/SettingsMenu/ru.yaml index 528aff49a1..422b00750f 100644 --- a/files/data/l10n/SettingsMenu/ru.yaml +++ b/files/data/l10n/SettingsMenu/ru.yaml @@ -13,7 +13,7 @@ LanguageNote: "Примечание: эти настройки не затраг LightingMethod: "Способ освещения" LightingMethodLegacy: "Устаревший" LightingMethodShaders: "Шейдеры" -LightingMethodShadersCompatibility: "Шейдеры (режим совместимости)" +LightingMethodShadersCompatibility: "Шейдеры (режим совм-ти)" LightingResetToDefaults: "Обнулить настройки освещения? Смена метода освещения вступит в силу только после перезапуска приложения." Lights: "Освещение" LightsBoundingSphereMultiplier: "Множитель размера ограничивающей сферы" diff --git a/files/data/mygui/openmw_dialogue_window.layout b/files/data/mygui/openmw_dialogue_window.layout index d1f96121e9..6d53d63351 100644 --- a/files/data/mygui/openmw_dialogue_window.layout +++ b/files/data/mygui/openmw_dialogue_window.layout @@ -18,7 +18,7 @@ - + diff --git a/files/data/mygui/openmw_persuasion_dialog.layout b/files/data/mygui/openmw_persuasion_dialog.layout index 3b10588ec8..977da40f8f 100644 --- a/files/data/mygui/openmw_persuasion_dialog.layout +++ b/files/data/mygui/openmw_persuasion_dialog.layout @@ -3,12 +3,12 @@ - + - + @@ -35,11 +35,11 @@ - + - + diff --git a/files/data/mygui/openmw_resources.xml b/files/data/mygui/openmw_resources.xml index 03ca91f5eb..70fccbfbe7 100644 --- a/files/data/mygui/openmw_resources.xml +++ b/files/data/mygui/openmw_resources.xml @@ -41,13 +41,13 @@ - + - + - - + + @@ -63,8 +63,8 @@ - - + + @@ -75,8 +75,8 @@ - - + + diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout index d698844d2e..9042a13546 100644 --- a/files/data/mygui/openmw_settings_window.layout +++ b/files/data/mygui/openmw_settings_window.layout @@ -5,7 +5,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -198,9 +198,9 @@ - + - + @@ -211,15 +211,15 @@ - + - + - + @@ -237,10 +237,10 @@ - + - + @@ -250,15 +250,15 @@ - + - + - + @@ -270,11 +270,11 @@ - + - + @@ -286,7 +286,7 @@ - + @@ -296,7 +296,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -369,7 +369,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -529,7 +529,7 @@ - + @@ -637,7 +637,7 @@ - + @@ -678,7 +678,7 @@ - + diff --git a/files/data/mygui/openmw_stats_window.layout b/files/data/mygui/openmw_stats_window.layout index 77de3ac753..2fcede969f 100644 --- a/files/data/mygui/openmw_stats_window.layout +++ b/files/data/mygui/openmw_stats_window.layout @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/files/data/mygui/openmw_text.skin.xml b/files/data/mygui/openmw_text.skin.xml index 5f96d0a57c..00a69c486b 100644 --- a/files/data/mygui/openmw_text.skin.xml +++ b/files/data/mygui/openmw_text.skin.xml @@ -149,18 +149,18 @@ color_misc=0,205,205 # ???? - + - + - + diff --git a/files/data/mygui/openmw_wait_dialog_progressbar.layout b/files/data/mygui/openmw_wait_dialog_progressbar.layout index 8147abbdfb..720bfa4327 100644 --- a/files/data/mygui/openmw_wait_dialog_progressbar.layout +++ b/files/data/mygui/openmw_wait_dialog_progressbar.layout @@ -4,7 +4,7 @@ - + diff --git a/files/openmw.cfg b/files/openmw.cfg index fb4cf70f5f..4c25d6ed98 100644 --- a/files/openmw.cfg +++ b/files/openmw.cfg @@ -71,9 +71,9 @@ fallback=Water_UnderwaterColor,012,030,037 fallback=Water_UnderwaterColorWeight,0.85 # fonts -fallback=Fonts_Font_0,Pelagiad +fallback=Fonts_Font_0,MysticCards fallback=Fonts_Font_1,DejaVuLGCSansMono -fallback=Fonts_Font_2,OMWAyembedt +fallback=Fonts_Font_2,DemonicLetters fallback=FontColor_color_normal,202,165,96 fallback=FontColor_color_normal_over,223,201,159 fallback=FontColor_color_normal_pressed,243,237,221 diff --git a/files/openmw.cfg.local b/files/openmw.cfg.local index cb05d5f22a..ee8bda8196 100644 --- a/files/openmw.cfg.local +++ b/files/openmw.cfg.local @@ -71,9 +71,9 @@ fallback=Water_UnderwaterColor,012,030,037 fallback=Water_UnderwaterColorWeight,0.85 # fonts -fallback=Fonts_Font_0,Pelagiad +fallback=Fonts_Font_0,MysticCards fallback=Fonts_Font_1,DejaVuLGCSansMono -fallback=Fonts_Font_2,OMWAyembedt +fallback=Fonts_Font_2,DemonicLetters fallback=FontColor_color_normal,202,165,96 fallback=FontColor_color_normal_over,223,201,159 fallback=FontColor_color_normal_pressed,243,237,221 diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 644858c4ff..8a6fc40fd7 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -192,9 +192,6 @@ scaling factor = 1.0 # Size of in-game fonts font size = 16 -# Resolution of TrueType fonts glyphs -ttf resolution = 75 - # Transparency of GUI windows (0.0 to 1.0, transparent to opaque). menu transparency = 0.84 diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 42b46080fd..6a50fc8a9b 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -946,7 +946,7 @@ 12 - 20 + 18 1 @@ -1063,33 +1063,6 @@ - - - - Resolution of TrueType fonts glyphs. Automatically takes in account UI scaling factor. -Lower values make text more blurry, higher ones - more pixelated. - - - TTF texture resolution - - - - - - - 50 - - - 125 - - - 5 - - - 75 - - -