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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15
    • GUI: Font handling
    • None
    • 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

            esabraha Eskil Abrahamsen Blomfeldt
            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