When rendering hinted text on Windows with DirectWrite, the goal was to keep the rendering and metrics as close to GDI as possible, minimizing the impact of changing the default font backend. Therefore, the DWRITE_RENDERING_MODE_GDI_CLASSIC was always preferred when hinting was on. However, DWRITE_RENDERING_MODE_GDI_CLASSIC only applies antialiasing in the horizontal direction, but GDI applies vertical antialiasing as well. The result is that text will look more aliased with DirectWrite than it did with GDI, which arguably looks ugly especially at large sizes and can be perceived as a regression. Microsoft documentation recommends using symmetric antialiasing when the pixel size exceeds 16, so this patch enables DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC for fonts larger than 16px regardless of whether hinting is on. It's worth noting that for fonts with heavy hinting, such as Times New Roman, the rendering using DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC is different from GDI, although more similar to Freetype. However, the impact of not having vertical antialiasing is worse and as native apps are moving towards using DirectWrite, the GDI rendering is not going to be the definition of a "native" look anymore. A second thing to note in this patch is that we always pass in false for the useGdiNatural argument in GetGdiCompatibleGlyphMetrics(). According to the documentation, we should be passing in true for text rendered with CLEARTYPE_NATURAL_QUALITY. However, doing this causes wider kerning in certain cases. Since the tighter kerning matches the layouts we get in native apps, as well as when using Freetype, I've chosen to pass false for now, to be consistent. This change also adds a manual test which can be used to switch between DirectWrite, GDI and Freetype rendering on Windows, so that it's easy to compare. [ChangeLog][Windows] Improved hinted text rendering at font sizes larger than 16px. Fixes: QTBUG-131946 Change-Id: Iebbe5c7affe7df6266ade6b161c31bde3d2caa84 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 407a98d94fb05780f30e77463fb2bd535041a044) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e59362678880cf89a2e7870365a030f0b9c254a7) |
||
|---|---|---|
| .. | ||
| auto | ||
| baseline | ||
| benchmarks | ||
| global | ||
| libfuzzer | ||
| manual | ||
| shared | ||
| testserver | ||
| CMakeLists.txt | ||
| README | ||
README
This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.
Linux X11:
* The user must be logged in to an active desktop; you can't run the
autotests without a valid DISPLAY that allows X11 connections.
* The tests are run against a KDE3 or KDE4 desktop.
* Window manager uses "click to focus", and not "focus follows mouse". Many
tests move the mouse cursor around and expect this to not affect focus
and activation.
* Disable "click to activate", i.e., when a window is opened, the window
manager should automatically activate it (give it input focus) and not
wait for the user to click the window.