diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-16 13:16:03 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-06-18 12:52:52 +0000 |
commit | 30ab9184ad452c892ddd02126ff52d7c7b5f5c38 (patch) | |
tree | 6798b50866c5cd98d866ba3b234d52b0d265135c /src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp | |
parent | 41bb5f362e49cc68b85022b749aaf654fa5c55bf (diff) |
Only turn off font hinting when really scaling
We don't want to turn off font hinting based on whether auto-scaling is on,
otherwise Qt Creator will look bad on a low-DPI screen. Instead, we turn it
off only if we have at least one screen that is scaled.
QHighDpiScaling::isActive() now means that there is actual scaling going on.
There is currently no need for the old meaning, so this change does not include
QHighDpiScaling::isEnabled().
Note that nothing can save us from the case where there is one high-DPI and
one low-DPI screen. In that case we choose looking bad on the low-DPI screen
instead of looking like crap on the high-DPI screen. Also note that our font
system we doesn't allow us to change our minds on hinting later when screens
are plugged in or removed.
Change-Id: I14a4ec7a49f4ba74a4c74684c7b951d0a71b951d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp')
-rw-r--r-- | src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 112bb8e0a6..c40bbf41b1 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -33,6 +33,7 @@ #include "qfontconfigdatabase_p.h" #include "qfontenginemultifontconfig_p.h" +#include "qhighdpiscaling_p.h" #include <QtCore/QList> #include <QtCore/QElapsedTimer> @@ -553,10 +554,8 @@ QFontEngine::HintStyle defaultHintStyleFromMatch(QFont::HintingPreference hintin break; } - if (QGuiApplication::platformNativeInterface()->nativeResourceForScreen("nofonthinting", - QGuiApplication::primaryScreen())) { + if (QHighDpiScaling::isActive()) return QFontEngine::HintNone; - } int hint_style = 0; if (FcPatternGetInteger (match, FC_HINT_STYLE, 0, &hint_style) == FcResultMatch) { |