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

Incorrect bounding rect calculations on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.2.2, 6.2.3, 6.3.0 Alpha
    • GUI: Font handling
    • None
    • Windows 10
    • Windows

    Description

      Qt calculates bounding rects incorrectly for a number of fonts that come preinstalled with Windows. This severely breaks my application when the user selects those fonts.

      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

      The first font shows how it should be: the text is tucked properly into the bounding rect and the baseline is at the correct position.

      For all other fonts in the example, the text does not align with the bounding rect and/or the baseline.

      Attachments

        1. drawText overload.png
          drawText overload.png
          62 kB
        2. drawText overload + FreeType.png
          drawText overload + FreeType.png
          61 kB
        3. Original screenshot.png
          Original screenshot.png
          65 kB
        4. qtbug-100304.cpp
          3 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes