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 <ritt.ks@gmail.com>
This commit is contained in:
parent
1721c83c27
commit
4f4da7462b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user