Skip to content

Commit

Permalink
Increase fixed font point size on Windows
Browse files Browse the repository at this point in the history
* Consolas runs smaller then the default system font. Increasing by 1 point size makes them look equal.
  • Loading branch information
droidmonkey committed Aug 6, 2023
1 parent a7f857d commit d025f02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d025f02

Please sign in to comment.