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

XCB: Completely bad font rendering when text changed in QML Text item using TTF font via FontLoader and some specific properties were provided

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.3.2, 5.4.0
    • None
    • Linux Fedora 20, (on Windows not observable)

    Description

      When text in Qml Text is changed during normal program run (after all Component.onCompletes) and some specific properties are provided – completely wrong font rendering happens. (see image I enclosed as attachment)

      To reproduce bug two Qml Text elements are at least needed. Moreover these Text items must have all three specific properties filled:

      1. renderType = Text.NativeRendering
      2. font.pixelSize
      3. font.family

      As for 2. (pixelSize) my investigation confirmed that pixelSize must be at same value in at least two Texts in order to observe bug and additionally must have value below 10

      As for 3. (family) for now I managed to reproduce bug only on DejaVuSans font familly (I tested a few of them: you can get it e.g. from: http://dejavu-fonts.org/wiki/Main_Page)

      I have also observed that setting antialiasing to false in any of these two Texts preserves from bug occur too.

      I discovered that issue in fairly big Qml project but I managed to make minimal example (.ttf font file next to .qml file needed):

      import QtQuick 2.4
      import QtQuick.Controls 1.2
      
      Rectangle {
          width: 100
          height: 100
          color: "lightgrey"
      
          FontLoader {
              id: fontLoader
              source: "DejaVuSansMono.ttf"
          }
      
          Column {
              anchors.top: parent.top
              anchors.horizontalCenter: parent.horizontalCenter
      
              Button {
                  text: "Show BUG!"
                  onClicked: text2.text = "This is a bug!"
              }
      
              Text {
                  id: text1
                  renderType: Text.NativeRendering
                  font.pixelSize: 10
                  font.family: fontLoader.name
                  text: "text"
              }
              Text {
                  id: text2
                  renderType: Text.NativeRendering
                  font.pixelSize: 10
                  font.family: fontLoader.name
                  text: "!"
              }
          }
      }
      

      Attachments

        1. FontRenderBug.qml
          0.8 kB
        2. font_bug.png
          font_bug.png
          2 kB
        3. qtbug44279.qml
          0.8 kB

        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
              pawelp Paweł Pietraszko
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes