From f7fb1002e6dc98da51889e573e1569f27bbac78f Mon Sep 17 00:00:00 2001 From: Evan Teran Date: Wed, 18 Mar 2026 01:46:01 -0400 Subject: [PATCH] fixing fixed width fonts in Qt6 --- src/Font.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Font.cpp b/src/Font.cpp index cc73c697c..9d25b2fd3 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -14,8 +14,17 @@ QFont fromString(const QString &fontName) { QFont font; font.fromString(fontName); font.setStyleName(QString()); -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + // NOTE(eteran): unfortunately, this line seems to matter + // despite being marked as deprecated, and Qt doesn't suggest + // a meaningful alternative font.setStyleStrategy(QFont::ForceIntegerMetrics); + QT_WARNING_POP +#else + font.setHintingPreference(QFont::PreferFullHinting); + font.setStyleStrategy(QFont::NoFontMerging); #endif return font; }