Converting TTF Fonts
Converting TTF fonts into QPF
Created by Latchesar Ionkov <firstname.lastname@example.org>
How to build makeqpf that works
I found three problems with makeqpf as it comes with qt-embedded.
This patch fixes a bug in qt-embedded. See the documentation of FT_Glyph_To_Bitmap in freetype/include/freetype/ftglyph.h if you don't believe me :)
The second patch makes Transformed display to work with qvfb instead of linuxfb. You need Transformed display to generate fonts (that are rotated on 270 degrees) for the Z. If you use linux framebuffer you don't need this patch.
For some reason I get segmentation faults when I convert arial*.ttf and times*.ttf. The segfaults are deep in the freetype code and happen when it renders 0x1fb character (latin small letter a with ring above and acute). As I really don't need this character, I left the real fix to somebody with more knowledge about the freetype code, patching qt-embedded to not try to render this character.
When you build qt-embedded, make sure that qt is configured to support TTF fonts (no QT_NO_FREETYPE in the qconfig.h you use). "Build everything" is ok. The commands I use to build qt-embedded are:
- QTDIR=. export QTDIR
- echo yes | ./configure -depths 16,32 -static -debug -qvfb
- make sub-src
- make -C tools/makeqpf
The build will produce makeqpf executable in $QTDIR/tools/makeqpf. It is statically linked and doesn't need qte libraries (and it is big :).
If you don't want to build it and you are brave enough to run binaries downloaded from weird ftp sites, you can get precompiled binary from
How to convert TTF fonts.
1. Make sure that you have Qtopia SDK installed. Set up QPEDIR, QTDIR and LD_LIBRARY_PATH variables as described in "Qtopia - Getting Started" document.
2. Put the TTF fonts you want to convert in $QPEDIR/lib/fonts
3. Add the font descriptions in $QPEDIR/lib/fonts/fontdir See http://doc.trolltech.com/2.3/fonts-qws.html for fontdir syntax If you want to use non-latin characters, don't forget the 'u' option in the font description.
4. Run qvfb
5. To get fonts for the Z, run makeqpf -display Transformed:Rot270 -A If you want to have the same fonts for the Qtopia SDK, run
- makeqpf -A
The fonts *_t10.qpf are the ones that should be installed on the Z (the rotated ones).
I am not sure that this is the best (and the only) way to produce QPF fonts from TTF. If you know better one I'll be glad to hear it.