The
setfont
command loads a font into the EGA/VGA character generator,
and optionally outputs the previous font.
This command reads an 8xH font from the file and loads it
into the character generator memory. Usually the font size H
will be clear from the file size, but if the input file has
code page format, containing the three fonts 8x8, 8x14 and 8x16,
the option -8 or -14 or -16 must be used to select one.
If no args are given (or only the option
-fontsize
), then a default font is loaded.
With the -v option,
setfont
will be verbose.
With the -V option, it prints its version.
As currently there is no mode switching support in the Linux kernel,
setfont
has nothing to do with the current EGA/VGA mode. It's totally user's
responsibility to choose a font matching the current video mode.
Font files are binary files of size 256*H bytes, containing
bit images for each of 256 characters, one byte per scan line, and
H bytes per character (0 < H <= 32).
Also .psf files are accepted; these files have the same format
but an additional 4 byte header.
The ordering of the symbols in the font is described by a
mapping table. Some fonts have a mapping table included in
the font file, and
setfont
will load such a mapping table. If no explicit mapping
table is included in the font, and no mapping table is
provided using the -m option, the `trivial' mapping is assumed.
In any case the mapping table just loaded is activated
by outputting the string Esc ( K.
Giving a
-m none
argument inhibits the loading and activation of a mapping table.
The previous mapping table can be saved to a file using the
-om file
option.
These options of setfont render mapscrn(8) obsolete.
The correspondence between the glyphs in the font and
Unicode values is described by a Unicode mapping table.
Some fonts have a Unicode mapping table included in
the font file, and an explicit table can be indicated using
the -u option.
Setfont
will load such a Unicode mapping table, unless a
-u none
argument is given. The previous Unicode mapping table
can be saved to a file using the
-ou file
option.
One may add a Unicode mapping table to a psf font using
psfaddtable (1).