Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Howto set a default font independant of platform or writing system.
Forum Updated to NodeBB v4.3 + New Features

Howto set a default font independant of platform or writing system.

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 186 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.
  • gde23G Offline
    gde23G Offline
    gde23
    wrote on last edited by
    #1

    Hello,

    I'm trying to set a default application font. At the moment I have this code

    QFont font;
    font.setFamily(font.defaultFamily());
    font.setStyleStrategy(QFont::PreferAntialias);
    a.setFont(font);
    

    which works fine for me on linux as well as windows, however when the user e.g. has set some Chinese font to their PC, defaultFamily() will return something that cannot be used without Chinese translation and therefore applies a (in my opinion not so beautiful) default font. How can I fallback to something like Sans/Arial here?

    1 Reply Last reply
    0

    • Login

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