Windows 10, Qt/QML 5.15.5 Liberation Sans is loaded by app, but Arial is being substituted. By Qt? By Windows?
Solved
QML and Qt Quick
-
The Liberation Sans font is loaded into the application font database directly. The font is also installed on Windows 10. Yet on my system, not for some reason on my co-workers, Arial is being substituted. Again, Liberation Sans is installed by the app and is a resource compiled into it. But looking at the number one (1), it is clear that Arial, which has no horizontal bar at its base, is being used instead of Liberation Sans, which does have a bar at its base.
Is there an explanation for this? Is there anything to be done to prevent it?
The other clue to this was that the zero (0) is far rounder in Liberation Sans than in Arial.
From main():
QFontDatabase::addApplicationFont("qrc:/imagine-assets/LiberationSans-Regular.ttf"); QFontDatabase::addApplicationFont("qrc:/imagine-assets/LiberationSans-Italic.ttf"); QFontDatabase::addApplicationFont("qrc:/imagine-assets/LiberationSans-Bold.ttf"); QFont appFont = QFont("Liberation"); appFont.setStyleHint(QFont::SansSerif); appFont.setHintingPreference(QFont::PreferNoHinting); QApplication::setFont(appFont);
Any help would be greatly appreciated.
Thanks.
-