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

QGraphicsTextItem->setHtml() ignores runtime loaded font

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.3.2
    • 5.3.0, 5.3.1
    • Widgets: GraphicsView
    • None
    • Linux (Arch amd64), Windows 7
    • 198009db79a85d3cab7fe3a6432635d36123a2d6

    Description

      Since Qt-5.3.0 the following code is wrongly rendered into QGraphicsView

      QGraphicsTextItem *item;
      item->setHtml("<span style=\"font-family: myFont; font-size: 12px;\">1=</span>
      <span style=\"font-size: 12px;\">Ре</span><br>
      <span style=\"font-family: myFont; font-size: 12px;\">2=</span>
      <span style=\"font-size: 12px;\">Ля</span><br>
      <span style=\"font-family: myFont; font-size: 12px;\">6=</span>
      <span style=\"font-size: 12px;\">Ре</span>
      

      It seems like "myFont" is ignored and some system font is used instead
      Those "strange" letters are from Cyrylic and interesting could be - when Latin letters are used instead of them, f.e.

      <span style=\"font-size: 12px;\">Re</span>
      

      "myFont" is displayed properly.
      Also "myFont" works well with QPushButton(s) and QLabel(s)
      Also this code worked for me from Qt-4.7 till Qt-5.2

      Attachments

        1. correct-Qt521.png
          2 kB
          Tomasz
        2. wrong-Qt531.png
          1 kB
          Tomasz

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              seelook Tomasz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes