Where does qt search for font files?



  • hi,

    i am a newbie to Qt, and i learned that qt will use the qt's /lib/fonts to search for the font files.
    but if configured with -fontconfig, does qt not use the directories added in /etc/fonts/fonts.conf to search the font files?

    Moved to embedded, Gerolf



  • AFAIK Qt uses the internal fonts on embedded systems. On Desktop systems, it should use the installed fonts.



  • Hi Gerolf,

    Thanks for your reply.
    Just to clarify, if i build qt using -embedded option, then the -fontconfig option will not be used, which means that the qt application will only use the font files in the qt's /lib/fonts?
    for example:
    ./configure -xplatform qws/linux-arm-g++ -embedded arm -fontconfig -prefix /path/to/install/ -otheroptions...
    then qt will only search the /path/to/install/lib/fonts directory?

    is there any option that allows qt to use the intalled fonts on embedded systems?



  • Hi adewang,

    AFAIK, on embedded, Qt uses the internal window manager which implies it uses the internal font's. I know no possibility to use system font's there, but you can add fonts to the fonts dir of Qt.



  • hi
    I'm use qt-everywhere-opensource-src-4.8.5 and compile to embedded linux .

    i got questions with fonts. What will qt do if i have many fonts in the font directory?

    I mean is it have search rule and fonts with multi language ?
    Because I put a multi language font to font directory, it didn't show,but when I kill all fonts in the directory beside the multi language font . It shows.

    So, what will I do ? kill all fonts that qt provide ?

    Thanks!!!



  • hi
    I'm use qt-everywhere-opensource-src-4.8.5 and compile to embedded linux .

    i got questions with fonts. What will qt do if i have many fonts in the font directory?

    I mean is it have search rule and fonts with multi language ?
    Because I put a multi language font to font directory, it didn't show,but when I kill all fonts in the directory beside the multi language font . It shows.

    So, what will I do ? kill all fonts that qt provide ?

    Thanks!!!



  • AFAIK, In the embedded platform, Qt looks for the fonts in /usr/lib/fonts directory

    @
    root@am335x-evm:/usr/lib/fonts# ls
    DejaVuSans-Bold.ttf VeraMoBI.ttf fixed_70_50.qpf helvetica_240_75i.qpf
    DejaVuSans-BoldOblique.ttf VeraMoBd.ttf fontdir helvetica_80_50.qpf
    DejaVuSans-Oblique.ttf VeraMoIt.ttf helvetica_100_50.qpf helvetica_80_50i.qpf
    DejaVuSans.ttf VeraMono.ttf helvetica_100_50i.qpf helvetica_80_75.qpf
    DejaVuSansMono-Bold.ttf VeraSe.ttf helvetica_100_75.qpf helvetica_80_75i.qpf
    DejaVuSansMono-BoldOblique.ttf VeraSeBd.ttf helvetica_100_75i.qpf japanese_230_50.qpf
    DejaVuSansMono-Oblique.ttf c0419bt_.pfb helvetica_120_50.qpf l047013t.pfa
    DejaVuSansMono.ttf c0582bt_.pfb helvetica_120_50i.qpf l047016t.pfa
    DejaVuSerif-Bold.ttf c0583bt_.pfb helvetica_120_75.qpf l047033t.pfa
    DejaVuSerif-BoldOblique.ttf c0611bt_.pfb helvetica_120_75i.qpf l047036t.pfa
    DejaVuSerif-Oblique.ttf c0632bt_.pfb helvetica_140_50.qpf l048013t.pfa
    DejaVuSerif.ttf c0633bt_.pfb helvetica_140_50i.qpf l048016t.pfa
    README c0648bt_.pfb helvetica_140_75.qpf l048033t.pfa
    UTBI____.pfa c0649bt_.pfb helvetica_140_75i.qpf l048036t.pfa
    UTB_____.pfa cour.pfa helvetica_180_50.qpf l049013t.pfa
    UTI_____.pfa courb.pfa helvetica_180_50i.qpf l049016t.pfa
    UTRG____.pfa courbi.pfa helvetica_180_75.qpf l049033t.pfa
    Vera.ttf couri.pfa helvetica_180_75i.qpf l049036t.pfa
    VeraBI.ttf cursor.pfa helvetica_240_50.qpf micro_40_50.qpf
    VeraBd.ttf dejavu_sans_11_50.qpf2 helvetica_240_50i.qpf unifont_160_50.qpf
    VeraIt.ttf fixed_120_50.qpf helvetica_240_75.qpf wqy-zenhei.ttc
    root@am335x-evm:/usr/lib/fonts#
    @

    And this is by default. You may change the qt-configuration to point to different location.

    And, for your question on "If you just copy your font to this directory, Qt doesnt display the string the selected language, if you delete the other font files, Qt can display the strings properly" - Are you sure if your platform has enough memory? Because AFAIK, Qt loads the font (Or you load it through application). When loading the font, Qt might use some memory to buffer the character set and the glyphs. (May be). This goes as my wild guess.

    It will be more interesting to see your system memory details.

    @
    root@am335x-evm:/usr/lib/fonts# df -h
    Filesystem Size Used Available Use% Mounted on
    /dev/root 3.6G 693.1M 2.7G 20% /
    devtmpfs 109.1M 4.0K 109.1M 0% /dev
    tmpfs 16.0M 492.0K 15.5M 3% /var/volatile
    tmpfs 121.3M 0 121.3M 0% /dev/shm
    tmpfs 16.0M 0 16.0M 0% /media/ram
    /dev/mmcblk0p1 69.5M 489.0K 69.0M 1% /var/volatile/run/media/mmcblk0p1

    @



  • AFAIK, In the embedded platform, Qt looks for the fonts in /usr/lib/fonts directory

    @
    root@am335x-evm:/usr/lib/fonts# ls
    DejaVuSans-Bold.ttf VeraMoBI.ttf fixed_70_50.qpf helvetica_240_75i.qpf
    DejaVuSans-BoldOblique.ttf VeraMoBd.ttf fontdir helvetica_80_50.qpf
    DejaVuSans-Oblique.ttf VeraMoIt.ttf helvetica_100_50.qpf helvetica_80_50i.qpf
    DejaVuSans.ttf VeraMono.ttf helvetica_100_50i.qpf helvetica_80_75.qpf
    DejaVuSansMono-Bold.ttf VeraSe.ttf helvetica_100_75.qpf helvetica_80_75i.qpf
    DejaVuSansMono-BoldOblique.ttf VeraSeBd.ttf helvetica_100_75i.qpf japanese_230_50.qpf
    DejaVuSansMono-Oblique.ttf c0419bt_.pfb helvetica_120_50.qpf l047013t.pfa
    DejaVuSansMono.ttf c0582bt_.pfb helvetica_120_50i.qpf l047016t.pfa
    DejaVuSerif-Bold.ttf c0583bt_.pfb helvetica_120_75.qpf l047033t.pfa
    DejaVuSerif-BoldOblique.ttf c0611bt_.pfb helvetica_120_75i.qpf l047036t.pfa
    DejaVuSerif-Oblique.ttf c0632bt_.pfb helvetica_140_50.qpf l048013t.pfa
    DejaVuSerif.ttf c0633bt_.pfb helvetica_140_50i.qpf l048016t.pfa
    README c0648bt_.pfb helvetica_140_75.qpf l048033t.pfa
    UTBI____.pfa c0649bt_.pfb helvetica_140_75i.qpf l048036t.pfa
    UTB_____.pfa cour.pfa helvetica_180_50.qpf l049013t.pfa
    UTI_____.pfa courb.pfa helvetica_180_50i.qpf l049016t.pfa
    UTRG____.pfa courbi.pfa helvetica_180_75.qpf l049033t.pfa
    Vera.ttf couri.pfa helvetica_180_75i.qpf l049036t.pfa
    VeraBI.ttf cursor.pfa helvetica_240_50.qpf micro_40_50.qpf
    VeraBd.ttf dejavu_sans_11_50.qpf2 helvetica_240_50i.qpf unifont_160_50.qpf
    VeraIt.ttf fixed_120_50.qpf helvetica_240_75.qpf wqy-zenhei.ttc
    root@am335x-evm:/usr/lib/fonts#
    @

    And this is by default. You may change the qt-configuration to point to different location.

    And, for your question on "If you just copy your font to this directory, Qt doesnt display the string the selected language, if you delete the other font files, Qt can display the strings properly" - Are you sure if your platform has enough memory? Because AFAIK, Qt loads the font (Or you load it through application). When loading the font, Qt might use some memory to buffer the character set and the glyphs. (May be). This goes as my wild guess.

    It will be more interesting to see your system memory details.

    @
    root@am335x-evm:/usr/lib/fonts# df -h
    Filesystem Size Used Available Use% Mounted on
    /dev/root 3.6G 693.1M 2.7G 20% /
    devtmpfs 109.1M 4.0K 109.1M 0% /dev
    tmpfs 16.0M 492.0K 15.5M 3% /var/volatile
    tmpfs 121.3M 0 121.3M 0% /dev/shm
    tmpfs 16.0M 0 16.0M 0% /media/ram
    /dev/mmcblk0p1 69.5M 489.0K 69.0M 1% /var/volatile/run/media/mmcblk0p1

    @


Log in to reply
 

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