Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84454

Multiple offset issues with text rendering

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P1: Critical
    • 5.15.1
    • 5.15.0
    • GUI: Text handling
    • None
    • Windows

    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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes