summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-11-25 16:30:32 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-03-25 17:10:29 (GMT)
commit5c46d9a4c85abbcc0b5db2bbbafded3efd784cd9 (patch)
tree1e63c67e562d3ed805a0412bb688949079e32697 /src/gui/text
parent47ce3672058d4cc6ca479f8b40d6cb821c38dd51 (diff)
downloadQt-5c46d9a4c85abbcc0b5db2bbbafded3efd784cd9.zip
Qt-5c46d9a4c85abbcc0b5db2bbbafded3efd784cd9.tar.gz
Qt-5c46d9a4c85abbcc0b5db2bbbafded3efd784cd9.tar.bz2
Take Xft.hintstyle by default to match the behavior of GTK+
For Qt apps running in GNOME, we use the GTK+ settings by default (instead of fontconfig settings). Task-number: QTBUG-13800 Reviewed-by: Samuel
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_x11.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp
index e442471..9f3f8d3 100644
--- a/src/gui/text/qfontengine_x11.cpp
+++ b/src/gui/text/qfontengine_x11.cpp
@@ -1029,7 +1029,12 @@ QFontEngineX11FT::QFontEngineX11FT(FcPattern *pattern, const QFontDef &fd, int s
#ifdef FC_HINT_STYLE
else {
int hint_style = 0;
- if (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hint_style) == FcResultNoMatch)
+ // Try to use Xft.hintstyle from XDefaults first if running in GNOME, to match
+ // the behavior of cairo
+ if (X11->fc_hint_style > -1 && X11->desktopEnvironment == DE_GNOME)
+ hint_style = X11->fc_hint_style;
+ else if (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hint_style) == FcResultNoMatch
+ && X11->fc_hint_style > -1)
hint_style = X11->fc_hint_style;
switch (hint_style) {