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

QFontMetrics::boundingRect() does not account for QFont::setLetterSpacing()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • Some future release
    • 4.5.2
    • GUI: Font handling
    • None
    • Qt/Embedded Linux

    Description

      Try the following code:

      QFont testFont;
      qDebug() << QFontMetrics(testFont).size(0, "abcdefg") << QFontMetrics(testFont).boundingRect("abcdefg");
      testFont.setLetterSpacing(QFont::PercentageSpacing, 200);
      qDebug() << QFontMetrics(testFont).size(0, "abcdefg") << QFontMetrics(testFont).boundingRect("abcdefg");

      In the first qDebug output, the numbers will be fairly similar; in the second, the boundingRect will be much narrower.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            eleccham Gordon Schumacher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes