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

[REG 6.2.2->6.2.3/6.3.0] Incorrect bounding rect calculations on macOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: P1: Critical P1: Critical
    • None
    • 6.2.3, 6.3.0 Beta1
    • GUI: Font handling
    • None
    • macOS 12.1
    • macOS

      Qt 6.2.3 and 6.3.0 Alpha calculate bounding rects improperly for a lot of fonts on macOS. This was not the case in 6.2.2 and it severely breaks my application when the user selects those fonts. Screenshots attached.

      The fonts used in the example are all fonts that come preinstalled with macOS.


       Here's what happens in the attached screenshot:

      1. For each font, the bounding rect is calculated using QFontMetricsF::boundingRect(const QString &text)
      2. The bounding rect is drawn
      3. The baseline of the text is drawn (by definition of the bounding rect, this is the line at y=0)
      4. The text is drawn

      On Qt 6.2.3 and Qt 6.3.0 Alpha, these fonts do not align with the bounding rect.

        1. Savoye LET in Apple Pages.png
          Savoye LET in Apple Pages.png
          16 kB
        2. qtbug-100298.cpp
          3 kB
        3. Academy Engraved LET in Apple Pages.png
          Academy Engraved LET in Apple Pages.png
          19 kB
        4. 6.2.3 with FreeType.png
          6.2.3 with FreeType.png
          1.08 MB
        5. 6.2.3.png
          6.2.3.png
          1006 kB
        6. 6.2.2.png
          6.2.2.png
          1009 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes