Fonts not showing Qt Apps in Qt5.7



  • Hi all, the fonts in my compiled Qt5 apps are not showing up. i understand Qt 5.7 do not carry fonts anymore and need to install separately. So i tried to cross-compile fontconfig but somehow unsuccessful. I've performed the following steps:

    1. Configure parameters for fontconfig are as follow:
    ./configure --prefix=/home/aa/Hi3536_SDK_V2.0.4.0/fontconfigArm --host=arm-hisiv400-linux --enable-static --disable-docs --enable-libxml2
    

    performed make function and received the following errors:

    config.status: creating src/fcstdint.h : _FONTCONFIG_SRC_FCSTDINT_H
    aa@aa:~/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1$ make
    make  all-recursive
    make[1]: Entering directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1'
    Making all in fontconfig
    make[2]: Entering directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1/fontconfig'
    make[2]: Nothing to be done for 'all'.
    make[2]: Leaving directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1/fontconfig'
    Making all in fc-blanks
    make[2]: Entering directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1/fc-blanks'
      GEN      fcblanks.h
    Traceback (most recent call last):
      File "./fc-blanks.py", line 14, in <module>
        from lxml import html
    ImportError: No module named lxml
    Makefile:595: recipe for target 'fcblanks.h' failed
    make[2]: *** [fcblanks.h] Error 1
    make[2]: Leaving directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1/fc-blanks'
    Makefile:581: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/home/aa/Hi3536_SDK_V2.0.4.0/otherFiles/fontsLib/fontconfig-2.12.1'
    Makefile:465: recipe for target 'all' failed
    make: *** [all] Error 2
    

    Does anyone has any advice?

    Thanks!



  • Hi,
    Instead of installing fonts separately, you can add fonts in resource.qrc file of your project as you add images. add the below line in qml file to import
    FontLoader { id: fontFamily; source: "/font/font.ttf" }


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.