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

QTextLine::height is not equal to QFontMetricsF::lineSpacing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Platform/s:
      All

      Description

      The documentation of QTextLine::height states that it should be equal to the sum of ascent, descent and leading, but in fact the result seems to be ceiled and is not the sum of the aforementioned (see: https://github.com/qt/qtbase/blob/dev/src/gui/text/qtextlayout.cpp#L1469). 

      When using QFontMetricsF on the other hand `lineSpacing` does report the not ceiled height.

      Either the implementation is wrong or the documentation is. In my opinion this is a bug, because as a client I cannot rely on QFontMetricsF without knowing how QQuickText is laying out its text (is it using the lineSpacing from font metrics or from QTextLine?).

        Attachments

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

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            marcel.gotsch Marcel Gotsch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes