From 0759ead9b6946041ba5c4996d023ce7944bb35c5 Mon Sep 17 00:00:00 2001 From: Techjar Date: Tue, 15 Sep 2020 04:33:30 -0400 Subject: [PATCH] Qt: Use better method of getting default monospace font This should give us a nicer font on Windows, while also not severely impacting the existing behavior on Linux. --- Source/Core/DolphinQt/Config/LogWidget.cpp | 3 +-- Source/Core/DolphinQt/Settings.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinQt/Config/LogWidget.cpp b/Source/Core/DolphinQt/Config/LogWidget.cpp index 577916e67a..c7b3a3330d 100644 --- a/Source/Core/DolphinQt/Config/LogWidget.cpp +++ b/Source/Core/DolphinQt/Config/LogWidget.cpp @@ -119,8 +119,7 @@ void LogWidget::UpdateFont() case 0: // Default font break; case 1: // Monospace font - f = QFont(QStringLiteral("Monospace")); - f.setStyleHint(QFont::TypeWriter); + f = QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()); break; case 2: // Debugger font f = Settings::Instance().GetDebugFont(); diff --git a/Source/Core/DolphinQt/Settings.cpp b/Source/Core/DolphinQt/Settings.cpp index 1721912bb8..6cb3435bf5 100644 --- a/Source/Core/DolphinQt/Settings.cpp +++ b/Source/Core/DolphinQt/Settings.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "AudioCommon/AudioCommon.h" @@ -489,8 +490,7 @@ void Settings::SetDebugFont(QFont font) QFont Settings::GetDebugFont() const { - QFont default_font = QFont(QStringLiteral("Monospace")); - default_font.setStyleHint(QFont::TypeWriter); + QFont default_font = QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont).family()); return GetQSettings().value(QStringLiteral("debugger/font"), default_font).value(); }