Details
-
Task
-
Resolution: Done
-
P1: Critical
-
5.15.0
-
None
Description
There are multiple offset and clipping errors related to emojis, high-dpi, GDI vs. DirectWrite and QT_QUICK_BACKEND=software.
They all seem to originate from the usage of a margin for the glyphs in the glyph cache, which is something we do primarily because hinted glyphs may extend to the left of their bounding rect. Since this is added in some places and accounted for elsewhere, it is quite a soup of potential problems.
First QTBUG-71928 was reported, which indicated that we were not accounting correctly for the margin in the DirectWrite font engine. It was attempted fixed by https://codereview.qt-project.org/c/qt/qtbase/+/284260 and the follow-up https://codereview.qt-project.org/c/qt/qtbase/+/288542.
It now seems like these changes were wrong, and that the font engine was doing it correctly. The way margins are added is that we expand the bounding rect to a negative origin, and DirectWrite handles this.
However, a confusing thing is that with high-dpi scaling, there is an offset on text that grows proportionally with the scale factor. This also happens with GDI, if you scale it. It looks like the offset is scaled with the matrix somehow, which is not intentional.
In addition to all this, there are QTBUG-80180 and QTBUG-84042, which are clipping bugs, but related in the way that they re-appear if we revert the fixes for QTBUG-71928.
So there is a need to really clean this stuff up and find out what the intended approach is. Also, check if the margin is actually needed with DirectWrite / unhinted text.
Attachments
For Gerrit Dashboard: QTBUG-84454 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
302002,2 | Fix various offset issues with DirectWrite font engine | dev | qt/qtbase | Status: MERGED | +2 | 0 |
302005,3 | Fix offset on native text rendering with high-dpi scaling | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
302111,3 | Fix various offset issues with DirectWrite font engine | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
302312,2 | Fix offset on native text rendering with high-dpi scaling | 5.15 | qt/qtdeclarative | Status: MERGED | +2 | 0 |