1SETFONT(8)                   International Support                  SETFONT(8)
2
3
4

NAME

6       setfont - load EGA/VGA console screen font
7

SYNOPSIS

9       setfont   [-O  font+umap.orig]  [-o  font.orig]  [-om  cmap.orig]  [-ou
10       umap.orig] [-N] [font.new ...]  [-m cmap] [-u umap] [-C console]  [-hH]
11       [-v] [-V]
12

DESCRIPTION

14       The  setfont  command  reads a font from the file font.new and loads it
15       into the EGA/VGA character generator, and optionally outputs the previ‐
16       ous  font.  It can also load various mapping tables and output the pre‐
17       vious versions.
18
19       If no args are given (or only the option -N for some number N), then  a
20       default  (8xN)  font is loaded (see below).  One may give several small
21       fonts, all containing a Unicode table, and setfont  will  combine  them
22       and load the union.  Typical use:
23
24       setfont
25              Load a default font.
26
27       setfont drdos8x16
28              Load a given font (here the 448-glyph drdos font).
29
30       setfont cybercafe -u cybercafe
31              Load  a  given font that does not have a Unicode map and provide
32              one explicitly.
33
34       setfont LatArCyrHeb-19 -m 8859-2
35              Load a given font (here a 512-glyph font combining several char‐
36              acter  sets)  and indicate that one's local character set is ISO
37              8859-2.
38
39       Note: if a font has more than 256 glyphs, only 8 out of 16  colors  can
40       be  used  simultaneously. It can make console perception worse (loss of
41       intensity and even some colors).
42
43

FONT FORMATS

45       The standard Linux font format is  the  PSF  font.   It  has  a  header
46       describing  font  properties like character size, followed by the glyph
47       bitmaps, optionally followed by a Unicode mapping table giving the Uni‐
48       code  value  for each glyph.  Several other (obsolete) font formats are
49       recognized.  If the input file has code page format (probably with suf‐
50       fix  .cp),  containing  three fonts with sizes e.g. 8x8, 8x14 and 8x16,
51       then one of the options -8 or -14 or -16 must be used  to  select  one.
52       Raw  font  files  are  binary files of size 256*N bytes, containing bit
53       images for each of 256 characters, one byte per scan line, and N  bytes
54       per  character  (0  < N <= 32).  Most fonts have a width of 8 bits, but
55       with the framebuffer device (fb) other widths can be used.
56
57

FONT HEIGHT

59       The program setfont has no built-in knowledge of VGA video  modes,  but
60       just  asks  the kernel to load the character ROM of the video card with
61       certain bitmaps. However, since Linux 1.3.1  the  kernel  knows  enough
62       about  EGA/VGA  video  modes  to  select a different line distance. The
63       default character height will be the number N inferred from the font or
64       specified  by option. However, the user can specify a different charac‐
65       ter height H using the -h option.
66
67

CONSOLE MAPS

69       Several mappings are involved in the path from user program  output  to
70       console  display. If the console is in utf8 mode (see unicode_start(1))
71       then the kernel expects that user program output is coded as UTF-8 (see
72       utf-8(7)),  and converts that to Unicode (ucs2).  Otherwise, a transla‐
73       tion table is used from the 8-bit program output to 16-bit Unicode val‐
74       ues.  Such  a translation table is called a Unicode console map.  There
75       are four of them: three built into  the  kernel,  the  fourth  settable
76       using  the  -m  option  of setfont.  An escape sequence chooses between
77       these four tables; after loading a cmap, setfont will output the escape
78       sequence Esc ( K that makes it the active translation.
79
80       Suitable  arguments  for  the -m option are for example 8859-1, 8859-2,
81       ..., 8859-15, cp437, ..., cp1250.
82
83       Given the Unicode value of the symbol to be displayed, the kernel finds
84       the  right glyph in the font using the Unicode mapping info of the font
85       and displays it.
86
87       Old fonts do not have Unicode mapping info, and in order to handle them
88       there are direct-to-font maps (also loaded using -m) that give a corre‐
89       spondence between user bytes and font positions.  The most common  cor‐
90       respondence  is the one given in the file trivial (where user byte val‐
91       ues are used directly as font positions).   Other  correspondences  are
92       sometimes  preferable  since the PC video hardware expects line drawing
93       characters in certain font positions.
94
95       Giving a -m none argument inhibits the loading and activation of a map‐
96       ping  table.  The previous console map can be saved to a file using the
97       -om file option.  These options of setfont render mapscrn(8)  obsolete.
98       (However, it may be useful to read that man page.)
99
100

UNICODE FONT MAPS

102       The correspondence between the glyphs in the font and Unicode values is
103       described by a Unicode mapping table.  Many fonts have a  Unicode  map‐
104       ping  table  included  in  the  font file, and an explicit table can be
105       indicated using the -u option. The program setfont  will  load  such  a
106       Unicode mapping table, unless a -u none argument is given. The previous
107       Unicode mapping table will be saved as part of the saved font file when
108       the -O option is used. It can be saved to a separate file using the -ou
109       file option.  These options of setfont render loadunimap(8) obsolete.
110
111       The Unicode mapping table should assign  some  glyph  to  the  `missing
112       character'  value  U+fffd,  otherwise missing characters are not trans‐
113       lated, giving a usually very confusing result.
114
115       Usually no mapping table is needed, and  a  Unicode  mapping  table  is
116       already contained in the font (sometimes this is indicated by the .psfu
117       extension), so that most users need not worry about the precise meaning
118       and functioning of these mapping tables.
119
120       One may add a Unicode mapping table to a psf font using psfaddtable(1).
121
122

OPTIONS

124       -h H   Override font height.
125
126       -m file
127              Load console map or Unicode console map from file.
128
129       -o file
130              Save previous font in file.
131
132       -O file
133              Save previous font and Unicode map in file.
134
135       -om file
136              Store console map in file.
137
138       -ou file
139              Save previous Unicode map in file.
140
141       -u file
142              Load Unicode table describing the font from file.
143
144       -C console
145              Set  the  font for the indicated console. (May require root per‐
146              missions.)
147
148       -v     Be verbose.
149
150       -V     Print version and exit.
151
152

NOTE

154       PC video hardware allows one to use the "intensity" bit either to indi‐
155       cate brightness, or to address 512 (instead of 256) glyphs in the font.
156       So, if the font has more than 256 glyphs, the console will  be  reduced
157       to 8 (instead of 16) colors.
158
159

FILES

161       /lib/kbd/consolefonts  is the default font directory.  /lib/kbd/unimaps
162       is the default directory for Unicode  maps.   /lib/kbd/consoletrans  is
163       the  default directory for screen mappings.  The default font is a file
164       default (or default8xN if the -N option was given for  some  number  N)
165       perhaps with suitable extension (like .psf).
166

SEE ALSO

168       psfaddtable(1), unicode_start(1), loadunimap(8), utf-8(7), mapscrn(8)
169
170
171
172                                  11 Feb 2001                       SETFONT(8)
Impressum