[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] /: Default to the system's scalable font, instead of whatever crazy font Qt considers to 
From:       Tomas Mecir <mecirt () gmail ! com>
Date:       2016-08-14 13:14:50
Message-ID: E1bYvFa-00074k-61 () code ! kde ! org
[Download RAW message or body]

Git commit a3ec78820715d070f8235bf5126ab7be176582a4 by Tomas Mecir.
Committed on 14/08/2016 at 13:13.
Pushed by mecir into branch 'master'.

Default to the system's scalable font, instead of whatever crazy font Qt considers to \
be "sans serif".

M  +1    -1    plugins/textshape/dialogs/CharacterHighlighting.cpp
M  +9    -1    sheets/Style.cpp

http://commits.kde.org/calligra/a3ec78820715d070f8235bf5126ab7be176582a4

diff --git a/plugins/textshape/dialogs/CharacterHighlighting.cpp \
b/plugins/textshape/dialogs/CharacterHighlighting.cpp index 9a912ad..83faaec 100644
--- a/plugins/textshape/dialogs/CharacterHighlighting.cpp
+++ b/plugins/textshape/dialogs/CharacterHighlighting.cpp
@@ -45,7 +45,7 @@ CharacterHighlighting::CharacterHighlighting(QWidget* parent)
     widget.setupUi(this);
 
     QStringList list;
-    KFontChooser::getFontList(list, KFontChooser::SmoothScalableFonts);
+    KFontChooser::getFontList(list, KFontChooser::ScalableFonts);
     m_fontChooser = new KFontChooser(this, KFontChooser::ShowDifferences, list, \
false);  m_fontChooser->setSampleBoxVisible(false);
     widget.fontLayout->addWidget(m_fontChooser);
diff --git a/sheets/Style.cpp b/sheets/Style.cpp
index d0f7ec2..775ead5 100644
--- a/sheets/Style.cpp
+++ b/sheets/Style.cpp
@@ -25,6 +25,7 @@
 #include <QBrush>
 #include <QHash>
 #include <QPen>
+#include <QFontDatabase>
 
 #include <KoGlobal.h>
 
@@ -908,7 +909,14 @@ void Style::setFont(QFont const & font)
 
 void Style::setFontFamily(QString const & family)
 {
-    insertSubStyle(FontFamily, family);
+    QString font = family;
+    // use the KDE default for sans serif, not Qt's default - this is because Qt \
doesn't return the default system font here +    if (font.toLower() == "sans serif") \
{ +        QFont f = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
+        font = f.family();
+    }
+
+    insertSubStyle(FontFamily, font);
 }
 
 void Style::setFontBold(bool enabled)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic