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

Line spacing of many fonts is dramatically different between Qt5 and Qt6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF
    • 6.2.4
    • GUI: Font handling
    • None
    • All
    • 1bc78f773 (dev), 79ad1c222 (dev), b7ecb93ba (6.8)

    Description

      Apologies if this is a duplicate. Our application (Musescore) uses QFontMetricsF::lineSpacing() to determine the line spacing of all the drawn textual elements. After switching to Qt6, the line spacing of our default font called Edwin has suddenly become much larger (see screenshots attached). The problem is not exclusive to Edwin: it affects all other fonts too (including New Century Schoolbook LT, of which Edwin is an open source clone), though the effect on Edwin is particularly large. It also seems to affect all platforms (for sure it does on Windows and Linux).

      On Windows, Qt 5.15.2 returns the following metrics for the Edwin font:
      QFontMetrics::ascent() -> 37
      QFontMetrics::descent() -> 14
      QFontMetrics::leading() -> 9

      Same platform, same font, same resolution, same point size, Qt 6.2.4 returns
      QFontMetrics::ascent() -> 56
      QFontMetrics::descent() -> 15
      QFontMetrics::leading() -> 10

      which results in a much larger value of QFontMetrics::lineSpacing(). The Edwin font files are attached.

      Is this a known issue? Are we doing something wrong?

      Attachments

        1. Edwin.zip
          350 kB
        2. Edwin-Roman.otf
          108 kB
        3. image-2024-05-23-16-43-09-450.png
          image-2024-05-23-16-43-09-450.png
          16 kB
        4. main.cpp
          2 kB
        5. NewCenturySchlbkLTStd.zip
          125 kB
        6. Screenshot 2024-05-22 163929.png
          Screenshot 2024-05-22 163929.png
          25 kB
        7. Screenshot 2024-05-22 163941.png
          Screenshot 2024-05-22 163941.png
          24 kB
        For Gerrit Dashboard: QTBUG-125585
        # Subject Branch Project Status CR V

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            michelespagnolo Michele Spagnolo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes