Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Not able do use a different font for the Application
Forum Updated to NodeBB v4.3 + New Features

Not able do use a different font for the Application

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 625 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    dynam1te
    wrote on last edited by dynam1te
    #1

    I want to change the default (fixed_120_50.qpf) font with a special font, I created myself. It's a .bdf file.

    I build makeqpf and used it to convert my .bdf file into a .qpf2 file, added the .qpf2 file in the $QT_DIR/lib/font folder.

    But now the application only displays a invalid square. Is there something that I'm missing?

    Note: I had to remove all the default files in $QT_DIR/lib/font, to make anything show up.
    Also: Is .qpf compatible with .qpf2? How can I convert a .qpf2 file to .qpf?

    Thanks in advance

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Praveen kk
      wrote on last edited by
      #2

      Are you trying to set a default font to your Qt application ? Then try this,

          int loadedFontID = QFontDatabase::addApplicationFont("<Your custom font pathname (TTF/PFA/PFB/BDF/QPF)>");
          QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(loadedFontID);
          fontName = loadedFontFamilies.value(0);
          QFont font;
          font.setFamily(fontName);
          app.setFont(font);
      
      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