From 4f4da7462bd1ea81c15136d90a0ba71aefbf793e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 23 Oct 2015 17:17:11 +0200 Subject: [PATCH] Support overlapping contours in glyph rasterizer fallback Truetype fonts should be rasterized with a winding fill as documented in e.g. Microsoft's specs. Failing to do this caused a bug when doing native rendering in Qt Quick for fonts that were large enough that the fallback path was taken when drawing the glyphs into the cache. If the glyph had overlapping contours, they would be subtracted from the shape. [ChangeLog][Text] Fixed an uncommon rendering error with fonts containing overlapping contours. Task-number: QTBUG-41197 Change-Id: I0e4a4432ba3f902bc3ea59d8f4dbd12a295630b2 Reviewed-by: Konstantin Ritt --- src/gui/text/qfontengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index bef4dc5547..6567859a5b 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -960,6 +960,7 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) pt.x = -glyph_x; pt.y = -glyph_y; // the baseline QPainterPath path; + path.setFillRule(Qt::WindingFill); QImage im(glyph_width + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); im.fill(Qt::transparent); QPainter p(&im);