From d60753154173ad6777b0e6b293bfaa50ea17f6b7 Mon Sep 17 00:00:00 2001 From: ilya-fedin Date: Mon, 4 May 2020 20:41:48 +0400 Subject: [PATCH] fix ifdef position and missed condition for demibold (#4) --- ui/style/style_core_font.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/style/style_core_font.cpp b/ui/style/style_core_font.cpp index 2f48c81..0442f6e 100644 --- a/ui/style/style_core_font.cpp +++ b/ui/style/style_core_font.cpp @@ -233,8 +233,8 @@ void StartFonts() { Ui::Integration::Instance().startFontsBegin(); } - if (!UseSystemFont) { #ifndef DESKTOP_APP_USE_PACKAGED_FONTS + if (!UseSystemFont) { bool areGood[FontTypesCount] = { false }; for (auto i = 0; i != FontTypesCount; ++i) { const auto name = FontTypeNames[i]; @@ -259,7 +259,6 @@ void StartFonts() { //QFont::insertSubstitution(name, fallback); #endif // Q_OS_WIN } -#endif // !DESKTOP_APP_USE_PACKAGED_FONTS #ifdef Q_OS_MAC auto list = QStringList(); @@ -272,6 +271,7 @@ void StartFonts() { } #endif // Q_OS_MAC } +#endif // !DESKTOP_APP_USE_PACKAGED_FONTS if (!CustomMainFont.isEmpty() && ValidateFont(CustomMainFont)) { Overrides[FontTypeRegular] = CustomMainFont; @@ -372,7 +372,7 @@ FontData::FontData(int size, uint32 flags, int family, Font *other) #ifdef DESKTOP_APP_USE_PACKAGED_FONTS } else { #else // DESKTOP_APP_USE_PACKAGED_FONTS - } else if (UseSystemFont) { + } else if (UseSystemFont && overrideIsEmpty) { #endif // !DESKTOP_APP_USE_PACKAGED_FONTS f.setWeight(QFont::DemiBold); }