diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-12-10 13:57:24 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2019-12-13 12:16:46 +0100 |
commit | 318a991907b6c08f52786160bafea1e30d3ad9bd (patch) | |
tree | c0b71149de6740bf8650a229e413dedfda6ab02e /src/platformsupport/fontdatabases | |
parent | 1e27db6c20913bf1c8b607f1eb5e899fc8f4112e (diff) |
Windows: Fix offset of glyphs with DirectWrite font engine
When fetching the bounding box of the alphamap for the glyph cache,
we would include the margins in the size, but we would not account for
it in the origin. We would therefore get a mismatch when copying the
alpha map into the cache.
[ChangeLog][Windows] Fixed a 2 pixel offset on glyphs when using
color fonts or any hinting preference other than the default (full)
hinting.
Fixes: QTBUG-71928
Change-Id: I9287df02de4f6e79c3b6c5ce92b73c284261ef5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/platformsupport/fontdatabases')
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp index 3415002ffc..98246de0a5 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp @@ -1012,8 +1012,8 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph int margin = glyphMargin(QFontEngine::Format_A32); - return glyph_metrics_t(rect.left, - rect.top, + return glyph_metrics_t(rect.left - margin, + rect.top - margin, rect.right - rect.left + margin * 2, rect.bottom - rect.top + margin * 2, bbox.xoff, bbox.yoff); |