From d025f02720d2b26295632301c99008e509c3f51e Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 16 Jul 2023 18:58:09 -0400 Subject: [PATCH] Increase fixed font point size on Windows * Consolas runs smaller then the default system font. Increasing by 1 point size makes them look equal. --- src/gui/Font.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/Font.cpp b/src/gui/Font.cpp index 8bb54863b..af939b0ad 100644 --- a/src/gui/Font.cpp +++ b/src/gui/Font.cpp @@ -34,13 +34,16 @@ QFont Font::fixedFont() auto consolasFont = QFontDatabase().font("Consolas", fixedFont.styleName(), fixedFont.pointSize()); if (consolasFont.family().contains("consolas", Qt::CaseInsensitive)) { fixedFont = consolasFont; + // Bump up the font size by one point to match the default font + fixedFont.setPointSize(fixedFont.pointSize() + 1); } #endif #ifdef Q_OS_MACOS // Qt doesn't choose a monospace font correctly on macOS fixedFont = QFontDatabase().font("Menlo", fixedFont.styleName(), fixedFont.pointSize()); #endif - +#ifndef Q_OS_WIN fixedFont.setPointSize(qApp->font().pointSize()); +#endif return fixedFont; }