BDF2PSF(1) | Console-setup User's Manual | BDF2PSF(1) |
bdf2psf - convert a BDF font to PSF format for the Linux console
bdf2psf [--fb] [--log logfile] bdf{+bdf} equivalence{+equivalence} symbols{+[:]symbols} size psf [sfm]
The program bdf2psf translates BDF fonts to PSF format. It accepts fonts with arbitrary size of the font matrix. If the width of the glyph matrix of the source font is 7 or 9 pixels then it generates fonts with width of 8 pixels.
The encodings of the traditional console fonts a similar to the standard encodings of the different languages. For example there are fonts for all variants of ISO 8859. This is redundant, for example ISO 8859-1, ISO 8859-9 and ISO 8859-15 differ only by few characters and can be easily covered by only one font.
In order to determine the minimal set of character sets a clustering algorithm has been used. The source code of fontconfig contains lists of the characters that most languages require - one list per language. We started with one character set per language and used the clustering algorithm in order to join the character sets to bigger. The character sets described in files installed in the directory fontsets were the result of the algorithm. These files list the unicodes of the symbols of the character set, one per line. Comments starting with a sharp sign are also allowed.
The files ascii.set, linux.set, freebsd.set and useful.set contain four special character sets. The first lists the ASCII symbols and the second and the third list the symbols from the so called alternate character set (see section "Line Graphics" of terminfo(5)) - one for Linux and one for FreeBSD. Notice that in order to limit itself to the cp437 character set, the Linux console driver does some approximations of the symbols from the alternate character set. For example it prints U+256A (BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE) instead of the not-equal sign. The file linux.set lists the symbols used by the Linux console driver (i.e. U+256A instead of the not-equal sign). The symbols from freebsd.set are not fixed by the FreeBSD kernel, but there too there are some approximations.
In most cases there is more available space in the fonts than necessary. The spare codes can be filled with the symbols from the useful.set special character set. It is convenient to use a colon before the name of useful.set on the command line of bdf2psf so no warnings are issued when there is no space in the font for some of these symbols.
The equivalence files define an equivalence relation between unicodes. The sharp sign is used for comments, the empty lines are ignored. All other lines should list two or more unicodes. Only one glyph will be allocated in the PSF font for these unicodes.
Example:
U+2126 U+03A9
# U+2126: OHM SIGN
# U+03A9: GREEK CAPITAL LETTER OMEGA
U+041D U+0048
# U+041D: CYRILLIC CAPITAL LETTER EN
# U+0048: LATIN CAPITAL LETTER H
This equivalence file says that U+2126 (the Ohm sign) and U+03A9 (Omega) have the same look so only one glyph is enough for them. And also U+041D (Cyrillic En) and U+0048 (Latin H) look the same.
Two equivalence files are provided - standard.equivalents and arabic.equivalents. The first one can be used for all fonts. The purpose of the second is to reduce the number of the necessary glyphs for the Arabic letters at the cost of the font quality. It should be used only for fonts that have to support Arabic but there is not enough space in the PSF font for all Arabic characters. The Uni1 character set is a character set that requires arabic.equivalents.
All mentioned files and directories are usually installed in /usr/share/bdf2psf or /usr/local/share/bdf2psf.
Anton Zinoviev <anton@lml.bas.bg>
2006-01-16 | console-setup |