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

QML has trouble with "Font-Awesome" font

    XMLWordPrintable

    Details

      Description

      FontAwesome is a very popular font for drawing icons on webpages.  It is a proper font with many font formats for a given release – .otf, .eot, .svg, .ttf, .woff, and .woff2.

      Some of them work!  Unfortunately, for many of the characters QML/Qt is rendering the font in a number of wrong ways, including in Korean:

       

      This is for font-awesome release v4.7.0.  Attached is the QML to draw the above picture v4.7.0.  I tried woff, woff2, ttf, and eot, but `FontLoader` only handled ttf and woff, with the same results for both file formats.

       

       

      Every character that looks like Chinese or Korean characters or Egyptian hieroglyphics is wrong.  This is what the icons are suppose to look like http://fontawesome.io/icons/ .  So, fa-adjust, fa-adn, fa-align-center, fa-anchor, fa-android, fa-angellist,fa-angle-double-down, and on and on.  These character names are aliases for the unicode encoding seen in the attached main.qml.  See new attachment "font_awesome_webpage_chrome_render.png".

       

      Font awesome is also distributed with an SVG version of the font, which I took and extracted out to a bunch of files.  Not all the `glyph`'s in the svg themselves render, because I just extracted the complete glyphs. Doing so gives a useful, if incomplete, comparison:

       

       

       test_qt.tar.gz contains the complete project, with the svgs, to reproduce the program for the above snapshot.

        Attachments

        1. font_awesome_webpage_snippet_chrome_render.png
          font_awesome_webpage_snippet_chrome_render.png
          137 kB
        2. fontawesome_ttf_qt5.9.1.png
          fontawesome_ttf_qt5.9.1.png
          851 kB
        3. fontawesome_ttf_vs_svg.png
          fontawesome_ttf_vs_svg.png
          800 kB
        4. fontawesome-webfont.ttf
          162 kB
        5. main.qml
          48 kB
        6. test_qt.tar.gz
          778 kB
        7. test_qt.zip
          1.17 MB
        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:
              ross.rogers Ross Rogers
            • Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes