Windows 10, Qt/QML 5.15.5 Liberation Sans is loaded by app, but Arial is being substituted. By Qt? By Windows?
-
wrote on 22 Nov 2021, 14:14 last edited by VFCraig
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.
-
wrote on 24 Nov 2021, 22:36 last edited by
Issue was the name used when setting the font. Should not be using, "Liberation", but "LiberationSans". That being the case, it was also not necessary to set the style to SansSerif, as that was the only style available for the "LiberationSans" font.
-
wrote on 29 Nov 2021, 15:16 last edited byThis post is deleted!
3/3