| Classes - Annotated - Tree - Functions - Home - Structure

# The Qt/Embedded fontdir file

In order for Qt/Embedded to run a file called fontdir needs to exist. It should be in either $QTDIR/lib/fonts/ if QTDIR is defined when the Qt/Embedded program is run, or /usr/local/qt-embedded/lib/fonts/ if not.

The format is as follows (also documented in qfontmanager_qws.cpp):

<name> <file> <renderer> <italic> <weight> <size> <flags>

name is the name that Qt/Embedded will use for the font in font dialogues and from the point of view of QFont - e.g. Times

file is the path to the file, for example times.ttf or /lib/fonts/times.ttf (the two are equivalent if QTDIR is defined to / for example)

renderer is the name of the font renderer for the font - for Truetype and Type 1 font files this should be FT, for Freetype, and for .bdf files it should be BDF

italic is either y to indicate this is an italic font or n to indicate that it is not

weight is a value between 0 and 100 - 50 is normal text, 75 is bold text

size is either 0 for a scalable font (i.e. any Truetype/Type 1 fonts) or 10 times the point size of the font for BDFs (e.g. 120 for a 12 point font)

flags consist of a series of characters - s indicates this font should be anti-aliased u is the unicode range when saving to a .qpf file (default is Latin1, i.e. 0-255) a is the ascii range when saving to a .qpf file (default is again Latin1)

Note that QPF files need not feature in the fontdir file, and indeed you can have an empty fontdir file and only use QPF files (in which case you don't need to link in either of the font rendering libraries). These should be stored in the same directory as fontdir and are loaded automatically when available. They can be generated with the -savefonts option when running a Qt/Embedded program.