Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9
-
None
Description
QPainter::TextAntialiasing and its relation to QFont::NoAntialias is confusing. The documentation states "Indicates that the engine should antialias text if possible. To forcibly disable antialiasing for text, do not use this hint. Instead, set QFont::NoAntialias on your font's style strategy" but it does not say when to enable the flag.
Looking at code where it's used, it is an optional opt-out in very specific cases. For instance, when the font size exceeds 64 pixels we will fall back to QPainterPath rendering in QPainter. Clearing the QPainter::TextAntialiasing flag will cause rendering to be aliased in this case, causing the text to go from smooth to chunky at a specific scale/size. This use case would be tricky to support with just the QFont::NoAntialias flag, but typically users will want antialiasing at large sizes and aliased rendering and small sizes, not the other way around. It also seems very arbitrary since it's decided by an implementation detail in the glyph cache logic.
So proposal is to deprecate this and leave it working, but get it out of the docs so it doesn't confuse people