[kde-doc-english] [trojita] src/Gui: GUI: Try to use a reasonable font size even on systems with no default config

Jan Kundrát jkt at flaska.net
Thu May 30 18:50:30 UTC 2013


Git commit 3732ed668965042c0f674e5048f14af6248fe95c by Jan Kundrát.
Committed on 30/05/2013 at 17:34.
Pushed by jkt into branch 'master'.

GUI: Try to use a reasonable font size even on systems with no default config

REVIEW: 110732

M  +11   -0    src/Gui/Util.cpp

http://commits.kde.org/trojita/3732ed668965042c0f674e5048f14af6248fe95c

diff --git a/src/Gui/Util.cpp b/src/Gui/Util.cpp
index ae76770..e14a80e 100644
--- a/src/Gui/Util.cpp
+++ b/src/Gui/Util.cpp
@@ -195,7 +195,18 @@ QFont systemMonospaceFont()
         // but the following works well -- at first, we come up with a made-up name, and then
         // let the Qt font substitution algorithm do its magic.
         font = QFont(QLatin1String("x-trojita-terminus-like-fixed-width"));
+        // Using QFont::Monospace results in a proportional font on jkt's system
         font.setStyleHint(QFont::TypeWriter);
+
+        // Gnome, Mac and perhaps everyone else uses 10pt as the default font size, so let's use that as well
+        int defaultPointSize = 10;
+        if (isRunningKde4()) {
+            // kdeui/kernel/kglobalsettings.cpp from KDELIBS sets default fixed font size to 9 on X11. Let's hope nobody runs
+            // this desktop-GUI-specific code *with KDE* under Harmattan or Mac. Seriously.
+            defaultPointSize = 9;
+
+        }
+        font.setPointSize(defaultPointSize);
     }
 
     return font;



More information about the kde-doc-english mailing list