Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
ff57057bc6844eb3c10ab0eadff292a10ef493f8
Description
Currently, the painter transformation used when painting a QStaticText will calculated into the cached glyph positions. This means that any change to the transformation will cause the QStaticText's layout to be recalculated, thus making it unusable in situations when the transformation is animated.
To avoid this, we need to support, in the engines that support QStaticText, rendering the glyphs without transformations and then transforming them at the last stage, when the paint engine actually draws them to the screen. This is already implemented for the OpenGL2 engine, but needs to be supported in all the other extended paint engines. This should also improve the appearance of QStaticText with rotations.
Some caveats to consider:
- When rotating text on systems with subpixel antialiasing, we need to fall back to regular antialiasing, to avoid ugliness. As a special case, we should support ninety degree rotations with subpixel antialiasing, since these rotations are common in UIs.
- Scaling the prerendered glyphs will give awful results that are really only suitable for animations. This needs to be handled somehow.