Does Qt5.15 still support qpf2 font?
-
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 -
I saw some introductions in the qt documentation, but they were not comprehensive.
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 \ "
-
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?