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. Does Qt5.15 still support qpf2 font?
Forum Updated to NodeBB v4.3 + New Features

Does Qt5.15 still support qpf2 font?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 1 Posters 487 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.
  • S Offline
    S Offline
    Stephen.vd
    wrote on last edited by
    #1

    I compiled qt5.15 in yocto and it runs normally on the arm64 board. I use QT_QPA_FONTDIR to specify the location of the font. However, when using the qpf2 font, no characters are displayed on the program. When using the ttf font, the display is normal.
    So I want to confirm whether qt5.15 still supports the qpf2 font? If it is supported, what configuration needs to be done for qtbase to use it?

    Regards,
    Stephen

    S 1 Reply Last reply
    0
    • S Stephen.vd

      I compiled qt5.15 in yocto and it runs normally on the arm64 board. I use QT_QPA_FONTDIR to specify the location of the font. However, when using the qpf2 font, no characters are displayed on the program. When using the ttf font, the display is normal.
      So I want to confirm whether qt5.15 still supports the qpf2 font? If it is supported, what configuration needs to be done for qtbase to use it?

      Regards,
      Stephen

      S Offline
      S Offline
      Stephen.vd
      wrote on last edited by
      #2

      I saw some introductions in the qt documentation, but they were not comprehensive.
      8cecd123-21b2-4d15-9bc4-300370731c6b-image.png

      My configuration

      QT_CONFIG_FLAGS = " \
          ${QT_CONFIG_FLAGS_GOLD} \
          -silent \
          -no-pch \
          -no-rpath \
          -pkg-config \
          -accessibility -no-cups -dbus -no-directfb -no-eglfs \
          -evdev -make examples -no-fontconfig -qt-freetype -no-gbm \
          -no-feature-getentropy -gif -no-opengl -no-glib -no-gtk \
          -qt-harfbuzz -ico -no-iconv -no-icu -no-journald \
          -system-libjpeg -no-kms -no-libinput -system-libpng -no-libproxy \
          -make libs -linuxfb -trace no -no-mtdev -no-openssl -qt-pcre -release \
          -no-sm -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc \
          -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds -shared -nomake tests \
          -make tools -tslib -no-libudev -no-vulkan -widgets -no-xcb -no-xkbcommon -qt-zlib \
          -qpa linuxfb \
      "
      
      S 1 Reply Last reply
      0
      • S Stephen.vd

        I saw some introductions in the qt documentation, but they were not comprehensive.
        8cecd123-21b2-4d15-9bc4-300370731c6b-image.png

        My configuration

        QT_CONFIG_FLAGS = " \
            ${QT_CONFIG_FLAGS_GOLD} \
            -silent \
            -no-pch \
            -no-rpath \
            -pkg-config \
            -accessibility -no-cups -dbus -no-directfb -no-eglfs \
            -evdev -make examples -no-fontconfig -qt-freetype -no-gbm \
            -no-feature-getentropy -gif -no-opengl -no-glib -no-gtk \
            -qt-harfbuzz -ico -no-iconv -no-icu -no-journald \
            -system-libjpeg -no-kms -no-libinput -system-libpng -no-libproxy \
            -make libs -linuxfb -trace no -no-mtdev -no-openssl -qt-pcre -release \
            -no-sm -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc \
            -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds -shared -nomake tests \
            -make tools -tslib -no-libudev -no-vulkan -widgets -no-xcb -no-xkbcommon -qt-zlib \
            -qpa linuxfb \
        "
        
        S Offline
        S Offline
        Stephen.vd
        wrote on last edited by Stephen.vd
        #3

        On the arm64 board, I use the code to load the font.
        can load ttf font, but can't load qpf2 font.

        fontId=QFontDatabase::addApplicationFont("/lib/qt-lib/fonts/sans_serif.ttf");
        qDebug() << fontId; //output 0
        
        fontId=QFontDatabase::addApplicationFont("/lib/qt-lib/fonts/sans_serif_12_75.qpf2");
        qDebug() << fontId; //output -1
        
        

        when load qpf2 font, it return an error like below:

        root@ARM64:~# ./font_test
        0
        FT_New_Face failed with index 0 : 2
        -1
        root@ARM64:~# ls /lib/qt-lib/fonts
        sans_serif.ttf                sans_serif2.ttf
        sans_serif_12_50.qpf2         sans_serif_16_75.qpf2         
        sans_serif_12_75.qpf2         sans_serif_15_50.qpf2
        sans_serif_15_75.qpf2         sans_serif_16_50.qpf2
        

        FreeType error code show the errno=2 is means "unknown file format"

        FT_NOERRORDEF_( Ok,                                        0x00,
                        "no error" )
        
        FT_ERRORDEF_( Cannot_Open_Resource,                        0x01,
                      "cannot open resource" )
        FT_ERRORDEF_( Unknown_File_Format,                         0x02,
                      "unknown file format" )
        

        So, how can I make my Qt recognize the qpf2 format 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