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

QGraphicsTextItem->setHtml() ignores runtime loaded font

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.3.0, 5.3.1
    • Fix Version/s: 5.3.2
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Environment:
      Linux (Arch amd64), Windows 7
    • Commits:
      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

          Issue Links

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

            Activity

              People

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