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. Windows 10, Qt/QML 5.15.5 Liberation Sans is loaded by app, but Arial is being substituted. By Qt? By Windows?
QtWS25 Last Chance

Windows 10, Qt/QML 5.15.5 Liberation Sans is loaded by app, but Arial is being substituted. By Qt? By Windows?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 1 Posters 341 Views
  • 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.
  • V Offline
    V Offline
    VFCraig
    wrote on 22 Nov 2021, 14:14 last edited by VFCraig
    #1

    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.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VFCraig
      wrote on 24 Nov 2021, 22:36 last edited by
      #2

      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.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        VFCraig
        wrote on 29 Nov 2021, 15:16 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0

        3/3

        29 Nov 2021, 15:16

        • Login

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