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

QFontMetrics::height always 1 px with specific font

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15.0 RC2
    • GUI: Font handling
    • None
    • Linux/Debian 64bit
    • Linux/X11

    Description

      In Linux/Debian drawing text with font "tiaofuheiti.ttf"(already uploaded) , find  QFontMetrics.height always is 1px.

      Following code, can get correct font height.

      QTextDocument doc(QStringLiteral("1"));
      doc.setDocumentMargin(0);
      doc.setDefaultFont(font());
      doc.adjustSize();
      int fontHeight = doc.size().height();

      It looks like is a qt's bug why QFontMetrics.height cannot get correct height.

      Please check that issue.

      Thank u in advance.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            killdms 泽 常
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes