-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed loading of custom font icons #636
Conversation
Looks like the QML fonts are not yet fixed (top right): I don't know much about QML, would you know if there's a similar way of loading the application database's fonts instead of the system's @nuttyartist ? |
Thanks for this!
I'm quite sure the qml loads the app fonts and not the system fonts since the path to the fonts is |
I guess it won't hurt to merge this even tho we still didn't figure why the QML fonts won't load? |
As long as all build jobs pass, I'm fine with that. |
Seems like it doesn't work for qt5 at the moment but I don't really have the time to figure out why at the moment. |
I'll look into it. |
I actually don't know why calling QFontDatabase::font should be needed, the docs don't seem to say that this is any different than loading via QFont's constructor. But I did notice we need to load two more fonts in main.cpp
Tho I don't think these are the fonts that don't load for you. |
I do see now that there are both |
I think maybe creating a separate class that loads fonts might be the best way. In that class, we can use a single #if. I'll look into trying that. |
Ahaha sounds promising. |
Alright lets see if this works |
4742fc2
to
e664992
Compare
Did it solve the problem? |
All checks seem to have passed and it seems to work on my system (linux, qt6), but we need to test it on other platforms as well. Can someone test on Windows & macOS? |
I tested on macOS and seems to be fine. I can test Windows tonight/tomorrow morning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine on Ubuntu 20.04 / Qt 5.12.
Tested on Windows, working well. Thanks, @zjeffer! Merging... |
Fixes #620
Apparently the QFont constructor doesn't load fonts from the application's database. We have to use
QFontDatabase::font
, which does load the fonts properly whenotf-font-awesome
is installed.I replaced every occurence of QFont when loading our custom fonts, with the QFontDatabase::font constructor.