diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-02 12:07:42 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-04 11:20:31 +0000 |
commit | 1ba0cfab308fff363973c3a15aa7f52908edf7af (patch) | |
tree | 0cb628a5a6fab7a78a458e1968a0c879627c4abb /src/platformsupport | |
parent | 9930ea92c1301ae13760a8492f69f381a65ada68 (diff) |
Windows: Fix high-dpi text rendering
In change ce2ae6ebd8cfebf9edbb0b5653e80de029669548 we added support for
hinted rendering to the DirectWrite engine. Previously, we would just
use the DirectWrite engine for all text rendering in high-dpi and assume
we would get only vertical hinting, but since the default changed, we
ended up scaling hinted text and the resulting text layouts were a mess.
Task-number: QTBUG-56841
Change-Id: I52101ea264878138de41878d1677c0ef8b522e78
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp index f266e85126..6130107cc8 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp @@ -49,6 +49,7 @@ #include <QtCore/private/qsystemlibrary_p.h> #include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> +#include <QtGui/private/qhighdpiscaling_p.h> #if defined(QT_USE_DIRECTWRITE2) # include <dwrite_2.h> @@ -185,6 +186,9 @@ namespace { static DWRITE_RENDERING_MODE hintingPreferenceToRenderingMode(QFont::HintingPreference hintingPreference) { + if (QHighDpiScaling::isActive() && hintingPreference == QFont::PreferDefaultHinting) + hintingPreference = QFont::PreferVerticalHinting; + switch (hintingPreference) { case QFont::PreferNoHinting: return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC; |