Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot use both regular and solid fonts together in the same Qt/QML application #12787
I often use Font Awesome in Qt/QML applications. In v4, this was quite straightforward, all that needed to be done was using a FontLoader and then set the font.family attribute of text elements to the font family (which could be retrieved via the
With v5, we now have several font files (e.g. there are 3
I would have expected to be able to select the variant by one of the following:
For the time being, I worked around the issue by editing the file
Thanks for considering!
Btw: The brands font file seems to work just fine, however, this is probably due to it uses a different font family name compared to the other two.
Thanks for being part of the Font Awesome Community.
Sorry but I cannot help. Let's wait for some feedback by the community
Please check with another font (with separate files for each style)
@robmadole is there something we can do about this?
thanks for the hint! I tried to reproduce this with another Font (I tried with Comfortaa) by doing the following:
as expected. And the rendering is as follows:
Which looks as expected. Then, I tried the same with Font Awesome:
The result: On standard out it prints:
qml: Font Awesome 5 Free
And the result is this:
Here, my expectation would have been that the lighter variants would use the icons from the regular font while the bolder ones use the one from the solid one.
One of our application we are using is using the qt QFontDatabase (https://doc.qt.io/qt-5/qfontdatabase.html#addApplicationFont) class and we are having a similar problem with it not being able to distinguish between the light/regular/solid TTF webfonts. The developer of that software company informed us that the cause of the issue is because all these TTF fonts have the exact same name: "Font Awesome 5 Pro".
Can you please add "Light", "Regular", and "Solid" to the name of these fonts so that libraries like Qt can distinguish them?
after your hint I tried my example from above with the most recent release. The good news: Using the
So it seems there were some fixes for these files :-)
In addition, I tried with the