388 lines
9.0 KiB
HTML
388 lines
9.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SETFONT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SETFONT</H1>
|
|
Section: International Support (8)<BR>Updated: 11 Feb 2001<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
setfont - load EGA/VGA console screen font
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>setfont</B>
|
|
|
|
[-O <I>font+umap.orig</I>] [-o <I>font.orig</I>]
|
|
|
|
[-om <I>cmap.orig</I>]
|
|
|
|
[-ou <I>umap.orig</I>]
|
|
|
|
[-<I>N</I>] [<I>font.new ...</I>]
|
|
|
|
[-m <I>cmap</I>]
|
|
|
|
[-u <I>umap</I>]
|
|
|
|
[-C <I>console</I>]
|
|
|
|
[-h<I>H</I>]
|
|
|
|
[-v] [-V]
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>setfont</B>
|
|
|
|
command reads a font from the file
|
|
<I>font.new</I>
|
|
|
|
and loads it into the EGA/VGA character generator,
|
|
and optionally outputs the previous font.
|
|
It can also load various mapping tables
|
|
and output the previous versions.
|
|
<P>
|
|
|
|
If no args are given (or only the option
|
|
-<I>N</I>
|
|
|
|
for some number
|
|
<I>N</I>),
|
|
|
|
then a default
|
|
(8x<I>N</I>)
|
|
|
|
font is loaded (see below).
|
|
One may give several small fonts, all containing
|
|
a Unicode table, and
|
|
<B>setfont</B>
|
|
|
|
will combine them and load the union.
|
|
Typical use:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>setfont</B>
|
|
|
|
<DD>
|
|
Load a default font.
|
|
<DT id="2"><B>setfont drdos8x16</B>
|
|
|
|
<DD>
|
|
Load a given font (here the 448-glyph drdos font).
|
|
<DT id="3"><B>setfont cybercafe -u cybercafe</B>
|
|
|
|
<DD>
|
|
Load a given font that does not have a Unicode map
|
|
and provide one explicitly.
|
|
<DT id="4"><B>setfont LatArCyrHeb-19 -m 8859-2</B>
|
|
|
|
<DD>
|
|
Load a given font (here a 512-glyph font combining several
|
|
character sets) and indicate that one's local character set
|
|
is ISO 8859-2.
|
|
</DL>
|
|
<P>
|
|
|
|
Note: if a font has more than 256 glyphs, only 8 out of 16 colors
|
|
can be used simultaneously. It can make console perception worse
|
|
(loss of intensity and even some colors).
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>FONT FORMATS</H2>
|
|
|
|
The standard Linux font format is the PSF font.
|
|
It has a header describing font properties like character size,
|
|
followed by the glyph bitmaps, optionally followed by a Unicode mapping
|
|
table giving the Unicode value for each glyph.
|
|
Several other (obsolete) font formats are recognized.
|
|
If the input file has code page format (probably with suffix .cp),
|
|
containing three fonts with sizes e.g. 8x8, 8x14 and 8x16, then one of
|
|
the options -8 or -14 or -16 must be used to select one.
|
|
Raw font files are binary files of size
|
|
256*<I>N</I>
|
|
|
|
bytes, containing bit images for each of 256 characters,
|
|
one byte per scan line, and
|
|
<I>N</I>
|
|
|
|
bytes per character (0 <
|
|
<I>N</I>
|
|
|
|
<= 32).
|
|
Most fonts have a width of 8 bits, but with the framebuffer device (fb)
|
|
other widths can be used.
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FONT HEIGHT</H2>
|
|
|
|
The program
|
|
<B>setfont</B>
|
|
|
|
has no built-in knowledge of VGA video modes, but just asks
|
|
the kernel to load the character ROM of the video card with
|
|
certain bitmaps. However, since Linux 1.3.1 the kernel knows
|
|
enough about EGA/VGA video modes to select a different line
|
|
distance. The default character height will be the number
|
|
<I>N</I>
|
|
|
|
inferred from the font or specified by option. However, the
|
|
user can specify a different character height
|
|
<I>H</I>
|
|
|
|
using the
|
|
<I>-h</I>
|
|
|
|
option.
|
|
<P>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CONSOLE MAPS</H2>
|
|
|
|
Several mappings are involved in the path from user program
|
|
output to console display. If the console is in utf8 mode (see
|
|
<B><A HREF="/cgi-bin/man/man2html?1+unicode_start">unicode_start</A></B>(1))
|
|
|
|
then the kernel expects that user program output is coded as UTF-8 (see
|
|
<B><A HREF="/cgi-bin/man/man2html?7+utf-8">utf-8</A></B>(7)),
|
|
|
|
and converts that to Unicode (ucs2).
|
|
Otherwise, a translation table is used from the 8-bit program output
|
|
to 16-bit Unicode values. Such a translation table is called a
|
|
<I>Unicode console map</I>.
|
|
|
|
There are four of them: three built into the kernel, the fourth
|
|
settable using the
|
|
<I>-m</I>
|
|
|
|
option of
|
|
<B>setfont</B>.
|
|
|
|
An escape sequence chooses between these four tables; after loading a
|
|
<I>cmap</I>,
|
|
|
|
<B>setfont</B>
|
|
|
|
will output the escape sequence Esc ( K that makes it the active translation.
|
|
<P>
|
|
|
|
Suitable arguments for the
|
|
<I>-m</I>
|
|
|
|
option are for example
|
|
<I>8859-1</I>,
|
|
|
|
<I>8859-2</I>, ...,
|
|
|
|
<I>8859-15</I>,
|
|
|
|
<I>cp437</I>, ...,
|
|
|
|
<I>cp1250</I>.
|
|
|
|
<P>
|
|
|
|
Given the Unicode value of the symbol to be displayed, the kernel
|
|
finds the right glyph in the font using the Unicode mapping info
|
|
of the font and displays it.
|
|
<P>
|
|
|
|
Old fonts do not have Unicode mapping info, and in order to handle
|
|
them there are direct-to-font maps (also loaded using
|
|
<I>-m</I>)
|
|
|
|
that give a correspondence between user bytes and font positions.
|
|
The most common correspondence is the one given in the file
|
|
<I>trivial</I>
|
|
|
|
(where user byte values are used directly as font positions).
|
|
Other correspondences are sometimes preferable since the
|
|
PC video hardware expects line drawing characters in certain
|
|
font positions.
|
|
<P>
|
|
|
|
Giving a
|
|
<I>-m none</I>
|
|
|
|
argument inhibits the loading and activation of a mapping table.
|
|
The previous console map can be saved to a file using the
|
|
<I>-om file</I>
|
|
|
|
option.
|
|
These options of setfont render
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mapscrn">mapscrn</A></B>(8)
|
|
|
|
obsolete. (However, it may be useful to read that man page.)
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>UNICODE FONT MAPS</H2>
|
|
|
|
The correspondence between the glyphs in the font and
|
|
Unicode values is described by a Unicode mapping table.
|
|
Many fonts have a Unicode mapping table included in
|
|
the font file, and an explicit table can be indicated using
|
|
the
|
|
<I>-u</I>
|
|
|
|
option. The program
|
|
<B>setfont</B>
|
|
|
|
will load such a Unicode mapping table, unless a
|
|
<I>-u none</I>
|
|
|
|
argument is given. The previous Unicode mapping table
|
|
will be saved as part of the saved font file when the -O
|
|
option is used. It can be saved to a separate file using the
|
|
<I>-ou file</I>
|
|
|
|
option.
|
|
These options of setfont render
|
|
<B><A HREF="/cgi-bin/man/man2html?8+loadunimap">loadunimap</A></B>(8)
|
|
|
|
obsolete.
|
|
<P>
|
|
|
|
The Unicode mapping table should assign some glyph to
|
|
the `missing character' value U+fffd, otherwise missing
|
|
characters are not translated, giving a usually very confusing
|
|
result.
|
|
<P>
|
|
Usually no mapping table is needed, and a Unicode mapping table
|
|
is already contained in the font (sometimes this is indicated
|
|
by the .psfu extension), so that most users need not worry
|
|
about the precise meaning and functioning of these mapping tables.
|
|
<P>
|
|
One may add a Unicode mapping table to a psf font using
|
|
<B><A HREF="/cgi-bin/man/man2html?1+psfaddtable">psfaddtable</A></B>(1).
|
|
|
|
<P>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="5"><B>-h </B><I>H</I>
|
|
|
|
<DD>
|
|
Override font height.
|
|
<DT id="6"><B>-m </B><I>file</I>
|
|
|
|
<DD>
|
|
Load console map or Unicode console map from
|
|
<I>file</I>.
|
|
|
|
<DT id="7"><B>-o </B><I>file</I>
|
|
|
|
<DD>
|
|
Save previous font in
|
|
<I>file</I>.
|
|
|
|
<DT id="8"><B>-O </B><I>file</I>
|
|
|
|
<DD>
|
|
Save previous font and Unicode map in
|
|
<I>file</I>.
|
|
|
|
<DT id="9"><B>-om </B><I>file</I>
|
|
|
|
<DD>
|
|
Store console map in
|
|
<I>file</I>.
|
|
|
|
<DT id="10"><B>-ou </B><I>file</I>
|
|
|
|
<DD>
|
|
Save previous Unicode map in
|
|
<I>file</I>.
|
|
|
|
<DT id="11"><B>-u </B><I>file</I>
|
|
|
|
<DD>
|
|
Load Unicode table describing the font from
|
|
<I>file</I>.
|
|
|
|
<DT id="12"><B>-C </B><I>console</I>
|
|
|
|
<DD>
|
|
Set the font for the indicated console. (May require root permissions.)
|
|
<DT id="13"><B>-v</B>
|
|
|
|
<DD>
|
|
Be verbose.
|
|
<DT id="14"><B>-V</B>
|
|
|
|
<DD>
|
|
Print version and exit.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>NOTE</H2>
|
|
|
|
PC video hardware allows one to use the "intensity" bit
|
|
either to indicate brightness, or to address 512 (instead of 256)
|
|
glyphs in the font. So, if the font has more than 256 glyphs,
|
|
the console will be reduced to 8 (instead of 16) colors.
|
|
<P>
|
|
<A NAME="lbAK"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<I>/usr/share/consolefonts</I>
|
|
|
|
is the default font directory.
|
|
<I>/usr/share/unimaps</I>
|
|
|
|
is the default directory for Unicode maps.
|
|
<I>/usr/share/consoletrans</I>
|
|
|
|
is the default directory for screen mappings.
|
|
The default font is a file
|
|
<I>default</I>
|
|
|
|
(or
|
|
<I>default8x</I>N
|
|
|
|
if the -N option was given for some number N)
|
|
perhaps with suitable extension (like .psf).
|
|
<A NAME="lbAL"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+psfaddtable">psfaddtable</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+unicode_start">unicode_start</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+loadunimap">loadunimap</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+utf-8">utf-8</A></B>(7),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mapscrn">mapscrn</A></B>(8)
|
|
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="15"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="16"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="17"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="18"><A HREF="#lbAE">FONT FORMATS</A><DD>
|
|
<DT id="19"><A HREF="#lbAF">FONT HEIGHT</A><DD>
|
|
<DT id="20"><A HREF="#lbAG">CONSOLE MAPS</A><DD>
|
|
<DT id="21"><A HREF="#lbAH">UNICODE FONT MAPS</A><DD>
|
|
<DT id="22"><A HREF="#lbAI">OPTIONS</A><DD>
|
|
<DT id="23"><A HREF="#lbAJ">NOTE</A><DD>
|
|
<DT id="24"><A HREF="#lbAK">FILES</A><DD>
|
|
<DT id="25"><A HREF="#lbAL">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:16 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|