Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Application and Font Awesome
Forum Updated to NodeBB v4.3 + New Features

QML Application and Font Awesome

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    msauer75
    wrote on last edited by
    #1

    Hi,

    I developed my qt qml application with qt 5.12.8 in linux and I use some icons from font awesome. In the linux application all icons are displayed correctly. But if I compile the same application under windows (with the same qt version) some icons from font awesome are changed.
    Do you know what I can do that all font awesome icons are displayed correctly in linux and windows?

    Thank you for your help.
    BR
    martin

    1 Reply Last reply
    0
    • SeeLookS Offline
      SeeLookS Offline
      SeeLook
      wrote on last edited by SeeLook
      #2

      Under Windows Qt uses another font engine, so You might try to force using freetype - the same as under Linux.
      Put qt.conf file with that content:

      [Platforms]
      WindowsArguments = fontengine=freetype
      

      next to your app executable.

      It does a trick for me.

      For Mac Os one has to compile Qt with freetype support first.

      M 1 Reply Last reply
      0
      • Quang PhuQ Offline
        Quang PhuQ Offline
        Quang Phu
        wrote on last edited by Quang Phu
        #3

        Hi @msauer75 ,
        I think you should download file ttf of awesome font, then add it into your project as a resource file.
        For me, It worked well with platforms (linux, ios, android,...). This is my initilization:

            property alias fontAwesome: fontAwesomeLoadder.name
        
            FontLoader {
                id: fontAwesomeLoadder
                source: "qrc:/assets/fa-solid-900.ttf"
            }
        

        I put it in Style.qml.
        Then when I want to use, simply use the fontAwesome
        This is example:

                    Text {
                        id: textIcon
                        anchors.centerIn: parent
                        font {
                            family: Style.fontAwesome
                            pixelSize: 40
                        }
                        text: "\uf11b"
                        color: "#eeeeee"
                        verticalAlignment: Text.AlignVCenter
                        horizontalAlignment: Text.AlignHCenter
                     }
        
        1 Reply Last reply
        3
        • SeeLookS SeeLook

          Under Windows Qt uses another font engine, so You might try to force using freetype - the same as under Linux.
          Put qt.conf file with that content:

          [Platforms]
          WindowsArguments = fontengine=freetype
          

          next to your app executable.

          It does a trick for me.

          For Mac Os one has to compile Qt with freetype support first.

          M Offline
          M Offline
          msauer75
          wrote on last edited by
          #4

          @SeeLook

          Thank you. That works

          BR
          martin

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved