Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.0
-
None
-
Windows 64 bit with 32 bit Qt@ANGLE
-
24c72029d8af27e2a85d695b692d48cc9b4ea467
Description
At smaller font sizes text with outline looks really bad. Looking at a scaled up version it seems like the outline is clipped with a bounding rect that is too small. See attached image outline_stock.png and the three renditions of the same text at different scales.
Doing some hacking in QSGDistanceFieldGlyphNode::updateGeometry() and changing line 216 from
qreal maxTexMargin = m_glyph_cache->distanceFieldRadius() / 2;
to
qreal maxTexMargin = m_glyph_cache->distanceFieldRadius();
results in better output as shown in outline_modified.png. For larger font sizes there is no difference as can be seen from the text at the bottom. The difference is especially noticeable with animated text in which case the stock text looks particularly horrible. Also attached the qml file for testing.
The core problem seems to be that the outline must get thicker relative to the font size when going for smaller fonts but the margin gets capped at some point. I realize outlined fonts can never look good for extremely small fonts but I think there's some room for improvement. Small outlined fonts are also useful when scaled up if you want a thicker outline.
Attachments
Issue Links
- relates to
-
QTBUG-98143 Text { style: Text.outline; clip: true } clips the outline at the edges
- Reported