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

Chinese characters are missing when non-regular font style are specifed in QtQuick2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 Beta
    • 5.3.0, 5.4.1, 5.5.0
    • None
    • Kubuntu15.04(Qt 5.4.1)
      Kubuntu14.10(Qt 5.3.0)
      Qt.5.5.1
      Ubuntu touch 15.04
    • 39e023b805cf2be207ef7086f6951e789e020bda, a856c4a902816a7d691ca50e6f556521287be441

    Description

      if developer specifies font family with Non-Regular style, potential risk to encounter Chinese characters are missing in some cases .
      E.g

      import QtQuick 2.4 
      import QtQuick.Controls 1.3 
      
      ApplicationWindow {
          visible: true
          width: 1280
          height: 800 
      
          Text {
              anchors.centerIn: parent
              text: "系统设置"
              font.family: "Ubuntu"
              font.pixelSize: 69;
              font.weight: Font.Light
          }
      }
      

      Regarding the code snippets above.
      For Chinese characters, QFontDatabase will use fallback font family("Droid Sans Fallback") with "Light" style when add font Glyph.

      since QFontDatabase checks if default style(Regular) of fallback font family "Droid Sans Fallback" is same as font style specified in qml(Font.Light).
      And QFontDatabase::isSmoothlyScalable will return false in such a case, which results in scene graph will
      use QSGDefaultGlyphNode when createGlyphNode is called. Issue happens.
      However If scene graph doesn't prefer NativeGlyphNode and create GlyphNode based on Distance Field technique. It works fine.

      Need to only check styleKey when foundry->styles == specified style

      Please have a check with the testcases.qml attached.

      Attachments

        1. 0001-Force-smoothly-scalable-for-fallback-font-family-wit.patch
          1 kB
          Gary.Wzl
        2. enable_fonts_always_smoothly.patch
          2 kB
          Timo Jyrinki
        3. Main.qml
          1 kB
          Timo Jyrinki
        4. testcases.qml
          1 kB
          Gary.Wzl

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            gary.wzl77 Gary.Wzl
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: