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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.15
    • GUI: Font handling
    • None
    • All

      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?).

        For Gerrit Dashboard: QTBUG-95311
        # Subject Branch Project Status CR V

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

              Created:
              Updated:

                There is 1 open Gerrit change