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

Type1 font breaks rendering of TTF font with the same name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.0 RC2
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      Linux, fontconfig

      Description

      The example below will consider FontAwesome, but the problem seems to happen with other fonts too. The bug results in absent glyphs as detected by QFontMetrics::inFont() and no rendering for most of the glyphs from the FontAwesome font.

      Test snippet:

      // CODEPOINT_OF_AWESOME_AMAZON='f270'
      // CODEPOINT_OF_AWESOME_HOME='f015'
      // CODEPOINT_OF_AWESOME_AT='f1fa'
      QString unicodeTest = QString::fromUtf8(u8"\uf270\uf015\uf1fa");
      QFont font(QLatin1String("FontAwesome"), 9, QFont::Normal);
      
      std::cerr << std::boolalpha;
      for (QChar c: unicodeTest) {
         std::cerr << " in font: " << QFontMetrics(font).inFont(c) << std::endl;
      }
      

      With the following fontconfig configuration:

      $ fc-list | grep -i "FontAwesome" 
      /usr/share/fonts/awesome-terminal-fonts/fontawesome-regular.ttf: FontAwesome:style=Regular
      /usr/share/texmf-dist/fonts/type1/public/fontawesome/FontAwesome.pfb: FontAwesome:style=Regular
      /usr/share/texmf-dist/fonts/opentype/public/fontawesome/FontAwesome.otf: FontAwesome:style=Regular
      
      $ fc-match FontAwesome
      fontawesome-regular.ttf: "FontAwesome" "Regular"
      

      the snippet does not find any of the glyphs. However, removing /usr/share/texmf-dist/fonts/type1/public/fontawesome/FontAwesome.pfb make it work and glyphs get rendered.

      Relative downstream bugs:
      https://bugs.gentoo.org/641880
      https://github.com/CDrummond/cantata/issues/903

      A simple test program: https://github.com/gamecreature/QtAwesome

        Attachments

        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:
            eugeneshalygin Eugene Shalygin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes