PDA

View Full Version : Font Problem



nrabara
18th December 2009, 09:20
Hi,

When I run application on my board, it shows following errors.



Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans-Bold.ttf
Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans.ttf
Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans-Oblique.ttf


I am not able to get fonts like, Adobe Courier, Adobe New Century School, Adobe Times, Sans Serif, Monospace, Andy MT, Sony Fixed, Utopia.

When I run same application on Desktop, I can get all type of font but not on my ARM board

I have installed all the fonts available in font dir to my board dir on right path.
I am able to get only Courier fonts.

Is there any need to install separate fonts(i.e. compile font library separately and place in to board)

Your suggestion would be a great help for me..

wysota
20th December 2009, 11:39
Does your board support true type fonts at all? It should do it through freetype library.

Tanuki-no Torigava
20th December 2009, 11:59
You need to check if Qt has been linked against libfreetype and libfontconfig:
Something like this:



ldd /usr/lib/qt4/libQtGui.so
linux-vdso.so.1 => (0x00007fff297a1000)
libaudio.so.2 => /usr/lib/libaudio.so.2 (0x0000003a99200000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x0000003a95600000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0000003a94e00000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x0000003a94a00000)
libSM.so.6 => /usr/lib/libSM.so.6 (0x0000003a97a00000)
libICE.so.6 => /usr/lib/libICE.so.6 (0x0000003a97e00000)
libQtCore.so.4 => /usr/lib/qt4/libQtCore.so.4 (0x0000003a90c00000)
libz.so.1 => /lib/libz.so.1 (0x0000003a92200000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x0000003a93a00000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0000003a91e00000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0x0000003a96200000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x0000003a96600000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x0000003a95e00000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0000003a95a00000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x0000003a94600000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x0000003a92e00000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/libstdc++.so.6 (0x0000003a94200000)
libm.so.6 => /lib/libm.so.6 (0x0000003a91a00000)
libc.so.6 => /lib/libc.so.6 (0x0000003a91200000)
libXt.so.6 => /usr/lib/libXt.so.6 (0x0000003a98200000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x0000003a93200000)
libuuid.so.1 => /lib/libuuid.so.1 (0x0000003a97600000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x0000003a90400000)
librt.so.1 => /lib/librt.so.1 (0x0000003a96e00000)
libdl.so.2 => /lib/libdl.so.2 (0x0000003a91600000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a8fc00000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x0000003a95200000)
libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0x0000003a92a00000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x0000003a93600000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0000003a93e00000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x0000003a92600000)


Notice libfreetype and libfontconfig. Also check if TrueType support has been enabled in freetype itself. If not - then you need to rebuild libfreetype and replace original one with new.

Regards,
-- tanuki

nrabara
22nd December 2009, 04:28
Thank for your suggestion, but still I am facing problem with fonts.


Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans-Bold.ttf
Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans.ttf
Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans-Oblique.ttf




Does your board support true type fonts at all? It should do it through freetype library.
I have cross compiled freetype font library and then recompiled qt embedded with freetype font libraray( command line option -system-freetype).

On my ARM board I dont have ldd command.
so I cant check linking like desktop as below
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0000003a95a00000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0000003a94e00000)

I have used strace, it shows me same,
Initializing QFontEngineQPF failed for /home/qt/lib/fonts/DejaVuSans-Bold.ttf



Also check if TrueType support has been enabled in freetype itself.

Is this mean to configure TTF in freetype font by using qconfig tool ?


If not - then you need to rebuild libfreetype and replace original one with new.
you mean to say, I need to update freetype font libraray in qt folder with the latest release and then recompile.

I have also tried makeqpf tool to convert .ttf file to .qpf2 but I think it also not functioning properly because it create very large filr verdana_50_50.qpf2(2.1 MB) from verdana.ttf(448 kb).

I really got stuck with this font problem, I would really appreciate if somebody put some more focus on this.

wysota
22nd December 2009, 06:44
I have also tried makeqpf tool to convert .ttf file to .qpf2 but I think it also not functioning properly because it create very large filr verdana_50_50.qpf2(2.1 MB) from verdana.ttf(448 kb).
That's normal. The file is bound to be larger than ttf because the glyphs are prerendererd.

Tanuki-no Torigava
22nd December 2009, 21:19
Is this mean to configure TTF in freetype font by using qconfig tool ?

Hi, freetype configuration described in many conferences and in FAQ on freetype site. As I remember you need to edit config file and enable TTF support for it (or via configure). Also, you need to recompile the fontconfig which is also linked against freetype and used by Qt for font operations.

Good luck,

-- tanuki

wysota
22nd December 2009, 23:43
Let's not be so hasty. There is 99% chance his libfreetype already supports TTF fonts, provided he has a plugin for Qt/Embedded to use it or that Qt links against it directly. Qt libs can be copied to desktop and ldd can be used there to determine that.

Tanuki-no Torigava
23rd December 2009, 06:29
Wysota, he hasn't ldd.



On my ARM board I dont have ldd command.
so I cant check linking like desktop as below
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0000003a95a00000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0000003a94e00000)


But he can use strings/grep to determine that. I'm not sure that all links in the chain are correct. Usually when you change underlying libraries you have to rebuild the whole chain for Qt.

wysota
23rd December 2009, 07:58
Wysota, he hasn't ldd.
Read my post again.