From 6f9ac7aba8ff27534cc2243cfd08573e50f66b6b Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:29:37 +0100 Subject: [PATCH 1/2] [Preferences] Exclude 8514oem from Monospace fonts --- src/Gui/PreferencePages/DlgSettingsEditor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Gui/PreferencePages/DlgSettingsEditor.cpp b/src/Gui/PreferencePages/DlgSettingsEditor.cpp index 4dd9734c49..b711307f45 100644 --- a/src/Gui/PreferencePages/DlgSettingsEditor.cpp +++ b/src/Gui/PreferencePages/DlgSettingsEditor.cpp @@ -26,6 +26,8 @@ # include #endif +#include + #include #include #include @@ -301,7 +303,10 @@ void DlgSettingsEditor::loadSettings() QStringList fixedFamilyNames; for (const auto &name : familyNames) { if (QFontDatabase().isFixedPitch(name)) { - fixedFamilyNames.append(name); + std::string utf8_name = name.toUtf8().constData(); + if (boost::iequals(utf8_name, "8514oem")) { + fixedFamilyNames.append(name); + } } } #else @@ -309,7 +314,10 @@ void DlgSettingsEditor::loadSettings() QStringList fixedFamilyNames; for (const auto &name : familyNames) { if (QFontDatabase::isFixedPitch(name)) { - fixedFamilyNames.append(name); + std::string utf8_name = name.toUtf8().constData(); + if (boost::iequals(utf8_name, "8514oem")) { + fixedFamilyNames.append(name); + } } } #endif From 384084048dc50ba2b5aed10bbb831b0d6dfcf8c4 Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:26:34 +0100 Subject: [PATCH 2/2] [Gui] Correct logic and use more simplistic condition --- src/Gui/PreferencePages/DlgSettingsEditor.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Gui/PreferencePages/DlgSettingsEditor.cpp b/src/Gui/PreferencePages/DlgSettingsEditor.cpp index b711307f45..170ba8fc0c 100644 --- a/src/Gui/PreferencePages/DlgSettingsEditor.cpp +++ b/src/Gui/PreferencePages/DlgSettingsEditor.cpp @@ -26,8 +26,6 @@ # include #endif -#include - #include #include #include @@ -303,8 +301,7 @@ void DlgSettingsEditor::loadSettings() QStringList fixedFamilyNames; for (const auto &name : familyNames) { if (QFontDatabase().isFixedPitch(name)) { - std::string utf8_name = name.toUtf8().constData(); - if (boost::iequals(utf8_name, "8514oem")) { + if (name.compare(QLatin1String("8514oem"), Qt::CaseInsensitive) != 0) { fixedFamilyNames.append(name); } } @@ -314,8 +311,7 @@ void DlgSettingsEditor::loadSettings() QStringList fixedFamilyNames; for (const auto &name : familyNames) { if (QFontDatabase::isFixedPitch(name)) { - std::string utf8_name = name.toUtf8().constData(); - if (boost::iequals(utf8_name, "8514oem")) { + if (name.compare(QLatin1String("8514oem"), Qt::CaseInsensitive) != 0) { fixedFamilyNames.append(name); } }