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

When using Harfbuzz NG on Mac OS X, setting the font stretch to be anything other than 100 will cause advances to be calculated incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.2, 5.7.0, 5.12.1
    • GUI: Text handling
    • None
    • Mac OS X
    • macOS

    Description

      Build and run the attached app to see the problem. Drag the slider forwards and backwards to alter the stretch. Observe that the glyphs are stretched correctly, but the advances are also scaled, which is incorrect.

      The problem here seems to be that the font stretch is 'baked in' to the CTFont we use to calculate the advances, yet the stretch is applied again to the advances in QTextEngine::shapeTextWithHarfbuzzNG.

      Oddly the code that does this scaling is Mac-only, and there's already a conditional to suppress it for Mac OS X 10.6 - see the code specific to QFontEngine::Mac towards the end of the function. Getting rid of this scaling entirely solves the problem, but I haven't looked back to ascertain why it was added in the first place.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            jlarcombe James Larcombe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes