Converting TTF Fonts

From OESF

Revision as of 04:17, 28 November 2004 by Offroadgeek (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Converting TTF fonts into QPF

Created by Latchesar Ionkov <lucho@ionkov.net>

How to build makeqpf that works

I found three problems with makeqpf as it comes with qt-embedded.

1. [qt-2.3.3-ft.patch]

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 :)

2. [qt-2.3.3-transformed.patch]

  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.

3. [qt-2.3.3-ch01fb.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

http://moria.ionkov.net/zaurus/makeqpf

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.

Personal tools