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

FontLoader returns preferred family name instead of font family name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.0
    • 5.9.6, 5.11.0
    • Quick: Other
    • Qt 5.9.6 and Qt 5.11.0 built with -system-freetype (Freetype: 2.9) on latest Gentoo Linux ~amd64.
    • 4601cd23f6c90372edbd4145833041bd7cf227cb (qt/qtdeclarative/dev)

    Description

      FontLoader {
          id: fontNormal
          source: "SourceSansPro-Light.ttf"
      }
      

      fontNormal.name is set to 'Source Sans Pro' which is the preferred name of the ttf.

      FontLoader {
          id: fontItaric
          source: "SourceSansPro-Light-Itaric.ttf"
      }
      

      fontItalic.name is also set to 'Source Sans Pro' which is the preferred name of the ttf.

       

      Text { font.family: fontNormal.name }  // will be italic one

      Then we can not apply fontNormal.name and fontItalic.name as they are because they are the same string and the font loaded at last will be applied in this case.

      Please find the example attached to reproduce the issue. Fonts are also in it.

      What I expect is that FontLoader sets its family name to the name property.

      • Source Sans Pro Light
      • Source Sans Pro Light Itaric

      Attachments

        1. fontloader.tar.gz
          259 kB
        2. qtbug68829_log.txt
          3 kB
        3. qtbug68829_qtbase_diag.diff
          3 kB
        4. qtbug68829_qtdeclarative_diag.diff
          1 kB
        5. qtbug68829.zip
          262 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-68829
          # Subject Branch Project Status CR V

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              tasuku.suzuki Tasuku Suzuki
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes