table of contents
BDF2PSF(1) | Console-setup User's Manual | BDF2PSF(1) |
NAME¶
bdf2psf - convert a BDF font to PSF format for the Linux console
SYNOPSIS¶
bdf2psf [--fb][--log logfile]bdf{+bdf}equivalence{+equivalence}symbols{+[:]symbols}size psf[sfm]
DESCRIPTION¶
The programbdf2psftranslates BDF fonts to PSF format. It accepts fonts with arbitrarysize of the font matrix. If the width of the glyph matrix of thesource font is 7 or 9 pixels then it generates fonts with width of 8pixels.
OPTIONS¶
- --fb
- Generate font for framebuffer. There are two important differencesbetween the framebuffer and the text mode. First, all fonts in textmode have to have matrix 8 pixels width. They also have to have either256 or 512 glyphs. Second, in most text modes the hardware does somemagic in order to use 8 pixels width fonts as if they were 9 pixelswidth. In order to achieve this the video hardware copies the 8thcolumn in the 9th column of the glyphs with codes from 0xC0 to 0xDFand from 0x1C0 to 0x1DF.Bdf2psfis very careful when deciding where to place a particular glyph and asa result the encoding of the generated font is more or less arbitrary.
- --log logfile
- Record in the filelogfileany problems during the conversion.
- bdf{+bdf}
- The "+"-separated list of the source BDF font(s). When a particularsymbol is defined in more than one of the specified fonts then fontslisted first take precedence.
- equivalence{+equivalence}
- A "+"-separated list of files defining an equivalence relationbetween the glyphs. See the section EQUIVALENCE FILES below.
- symbols{+[:]symbols}
- A "+"-separated list of files describing character sets. Thegenerated font will support all specified character sets. When thereis no space in the PSF font for all symbols, the character sets listedfirst take precedence. When a colon before a character set isspecified no warnings will be issued for symbols that could not beplaced in the font. See the section CHARACTER SETS below.
- size
- The size of the PSF font. Usually 256 or 512 glyphs.
- psf
- The name of the generated font. If a file with this name alreadyexists it will be overwritten.
- sfm
- Save in the filesfmthe SFM of the generated font. This parameter is optional.
CHARACTERSETS¶
The encodings of the traditional console fonts a similar to thestandard encodings of the different languages. For example there arefonts for all variants of ISO 8859. This is redundant, for exampleISO 8859-1, ISO 8859-9 and ISO 8859-15 differ only by few charactersand can be easily covered by only one font.
In order to determine the minimal set of character sets a clusteringalgorithm has been used. The source code offontconfigcontains lists of the characters that most languages require - onelist per language. We started with one character set per language andused the clustering algorithm in order to join the character sets tobigger. The character sets described in files installed in thedirectoryfontsetswere the result of the algorithm.These files list the unicodes of the symbols of the character set, oneper line. Comments starting with a sharp sign are also allowed.
The filesascii.set, linux.set, freebsd.set and useful.setcontain four special character sets. The first lists the ASCIIsymbols and the second and the third list the symbols from the socalled alternate character set (see section "Line Graphics" ofterminfo(5))- one for Linux and one for FreeBSD. Notice that in order to limititself to the cp437 character set, the Linux console driver does someapproximations of the symbols from the alternate character set. Forexample it prints U+256A (BOX DRAWINGS VERTICAL SINGLE AND HORIZONTALDOUBLE) instead of the not-equal sign. The file linux.set lists thesymbols used by the Linux console driver (i.e. U+256A instead of thenot-equal sign). The symbols from freebsd.set are not fixed by theFreeBSD kernel, but there too there are some approximations.
In most cases there is more available space in the fonts thannecessary. The spare codes can be filled with the symbols from theuseful.setspecial character set. It is convenient to use a colon before thename ofuseful.seton the command line ofbdf2psfso no warnings are issued when there is no space in the font for someof these symbols.
EQUIVALENCEFILES¶
The equivalence files define an equivalence relation betweenunicodes. The sharp sign is used for comments, the empty lines areignored. All other lines should list two or more unicodes. Only oneglyph 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. Andalso U+041D (Cyrillic En) and U+0048 (Latin H) look the same.
Two equivalence files are provided -standard.equivalentsandarabic.equivalents.The first one can be used for all fonts. The purpose of the second isto reduce the number of the necessary glyphs for the Arabic letters atthe cost of the font quality. It should be used only for fonts thathave to support Arabic but there is not enough space in the PSF fontfor all Arabic characters. TheUni1character set is a character set that requiresarabic.equivalents.
FILES¶
All mentioned files and directories are usually installed in/usr/share/bdf2psfor/usr/local/share/bdf2psf.
AUTHOR¶
Anton Zinoviev <anton@lml.bas.bg>
2006-01-16 | console-setup |