Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is there a way of using QPF2 font format on Desktop application?
Qt 6.12 LTS is out! See what's new in the release blog

Is there a way of using QPF2 font format on Desktop application?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 810 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.
  • K Offline
    K Offline
    kimono
    wrote on last edited by kimono
    #1

    I want to use a font, but i don't know what font it is.The only thing I have is a qpf2 file.
    I have try QFontDatabase::addApplicationFont() which return -1.
    I also set QT_QPA_FONTDIR, but QFontDatabase.families() still did not include it.
    Any suggestions are appreciated
    qpf2 file

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which version of Qt are you using ?
      On which platform ?

      More information on the format can be found here.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Which version of Qt are you using ?
        On which platform ?

        More information on the format can be found here.

        K Offline
        K Offline
        kimono
        wrote on last edited by kimono
        #3

        @SGaist Thank you for your reply.
        I have tried 2 versions, same result.
        win11 + QT4.8.7
        ubuntu20.04 LTS + QT5.12.12

            int fontId=QFontDatabase::addApplicationFont("/home/nut/Desktop/Vera.ttf");
            qDebug() << fontId; //output 0
        
            int fontId=QFontDatabase::addApplicationFont("/home/nut/Desktop/ds.qpf2");
            qDebug() << fontId; //output -1
        

        It can load ttf font, but can't load qpf2 font.
        On win11, I place qpf2 font into D:\Qt_\4.8.7\lib\fonts, don't work.
        On Ubuntu, $QTDIR/lib/fonts don't exist, so I create it, dont' work too.

        I know QPF2 is designed for Qt for Embedded Linux.
        Since Embedded Linux can load qpf2, I think a more complete linux , ubuntu should also work.

        SGaistS 1 Reply Last reply
        0
        • K kimono

          @SGaist Thank you for your reply.
          I have tried 2 versions, same result.
          win11 + QT4.8.7
          ubuntu20.04 LTS + QT5.12.12

              int fontId=QFontDatabase::addApplicationFont("/home/nut/Desktop/Vera.ttf");
              qDebug() << fontId; //output 0
          
              int fontId=QFontDatabase::addApplicationFont("/home/nut/Desktop/ds.qpf2");
              qDebug() << fontId; //output -1
          

          It can load ttf font, but can't load qpf2 font.
          On win11, I place qpf2 font into D:\Qt_\4.8.7\lib\fonts, don't work.
          On Ubuntu, $QTDIR/lib/fonts don't exist, so I create it, dont' work too.

          I know QPF2 is designed for Qt for Embedded Linux.
          Since Embedded Linux can load qpf2, I think a more complete linux , ubuntu should also work.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Since it's explicitly stated as a Qt for Embedded Linux feature, my educated guess is that the support for it will only be built if you do such a Qt build.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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
          • Unsolved