From 1ba0cfab308fff363973c3a15aa7f52908edf7af Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 2 Nov 2016 12:07:42 +0100 Subject: 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 --- .../fontdatabases/windows/qwindowsfontenginedirectwrite.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 #include #include +#include #if defined(QT_USE_DIRECTWRITE2) # include @@ -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; -- cgit v1.2.3