logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

setfont.8 (7438B)


  1. .TH SETFONT 8 "11 Feb 2001" "kbd"
  2. .SH NAME
  3. setfont \- load EGA/VGA console screen font
  4. .SH SYNOPSIS
  5. .B setfont
  6. .RB [ -O
  7. .IR font+umap.orig ]
  8. .RB [ -o
  9. .IR font.orig ]
  10. .RB [ -om
  11. .IR cmap.orig ]
  12. .RB [ -ou
  13. .IR umap.orig ]
  14. .RB [ -\c
  15. .IR N ]
  16. .RI [ "font.new ...\&" ]
  17. .RB [ -m
  18. .IR cmap ]
  19. .RB [ -u
  20. .IR umap ]
  21. .RB [ -C
  22. .IR console ]
  23. .RB [ -h\c
  24. .IR H ]
  25. .RB [ -v ]
  26. .RB [ -V ]
  27. .IX "setfont command" "" "\fLsetfont\fR command"
  28. .SH DESCRIPTION
  29. The
  30. .B setfont
  31. command reads a font from the file
  32. .I font.new
  33. and loads it into the EGA/VGA character generator,
  34. and optionally outputs the previous font.
  35. It can also load various mapping tables
  36. and output the previous versions.
  37. .LP
  38. If no args are given (or only the option
  39. .RI \- N
  40. for some number
  41. .IR N ),
  42. then a default
  43. .RI (8x N )
  44. font is loaded (see below).
  45. One may give several small fonts, all containing
  46. a Unicode table, and
  47. .B setfont
  48. will combine them and load the union.
  49. Typical use:
  50. .TP
  51. .B setfont
  52. Load a default font.
  53. .TP
  54. .B "setfont drdos8x16"
  55. Load a given font (here the 448-glyph drdos font).
  56. .TP
  57. .B "setfont cybercafe -u cybercafe"
  58. Load a given font that does not have a Unicode map
  59. and provide one explicitly.
  60. .TP
  61. .B "setfont LatArCyrHeb-19 -m 8859-2"
  62. Load a given font (here a 512-glyph font combining several
  63. character sets) and indicate that one's local character set
  64. is ISO 8859-2.
  65. .LP
  66. Note: if a font has more than 256 glyphs, only 8 out of 16 colors
  67. can be used simultaneously. It can make console perception worse
  68. (loss of intensity and even some colors).
  69. .SH "FONT FORMATS"
  70. The standard Linux font format is the PSF font.
  71. It has a header describing font properties like character size,
  72. followed by the glyph bitmaps, optionally followed by a Unicode mapping
  73. table giving the Unicode value for each glyph.
  74. Several other (obsolete) font formats are recognized.
  75. If the input file has code page format (probably with suffix .cp),
  76. containing three fonts with sizes e.g. 8x8, 8x14 and 8x16, then one of
  77. the options \-8 or \-14 or \-16 must be used to select one.
  78. Raw font files are binary files of size
  79. .RI 256* N
  80. bytes, containing bit images for each of 256 characters,
  81. one byte per scan line, and
  82. .I N
  83. bytes per character (0 <
  84. .I N
  85. <= 32).
  86. Most fonts have a width of 8 bits, but with the framebuffer device (fb)
  87. other widths can be used.
  88. .SH "FONT HEIGHT"
  89. The program
  90. .B setfont
  91. has no built-in knowledge of VGA video modes, but just asks
  92. the kernel to load the character ROM of the video card with
  93. certain bitmaps. However, since Linux 1.3.1 the kernel knows
  94. enough about EGA/VGA video modes to select a different line
  95. distance. The default character height will be the number
  96. .I N
  97. inferred from the font or specified by option. However, the
  98. user can specify a different character height
  99. .I H
  100. using the
  101. .I "\-h"
  102. option.
  103. .SH "CONSOLE MAPS"
  104. Several mappings are involved in the path from user program
  105. output to console display. If the console is in utf8 mode (see
  106. .BR unicode_start (1))
  107. then the kernel expects that user program output is coded as UTF-8 (see
  108. .BR utf-8 (7)),
  109. and converts that to Unicode (ucs2).
  110. Otherwise, a translation table is used from the 8-bit program output
  111. to 16-bit Unicode values. Such a translation table is called a
  112. .IR "Unicode console map" .
  113. There are four of them: three built into the kernel, the fourth
  114. settable using the
  115. .I "\-m"
  116. option of
  117. .BR setfont .
  118. An escape sequence chooses between these four tables; after loading a
  119. .IR cmap ,
  120. .B setfont
  121. will output the escape sequence Esc ( K that makes it the active translation.
  122. .LP
  123. Suitable arguments for the
  124. .I "\-m"
  125. option are for example
  126. .IR 8859-1 ,
  127. .IR 8859-2 ", ...,"
  128. .IR 8859-15 ,
  129. .IR cp437 ", ...,"
  130. .IR cp1250 .
  131. .LP
  132. Given the Unicode value of the symbol to be displayed, the kernel
  133. finds the right glyph in the font using the Unicode mapping info
  134. of the font and displays it.
  135. .LP
  136. Old fonts do not have Unicode mapping info, and in order to handle
  137. them there are direct-to-font maps (also loaded using
  138. .IR "\-m" )
  139. that give a correspondence between user bytes and font positions.
  140. The most common correspondence is the one given in the file
  141. .I trivial
  142. (where user byte values are used directly as font positions).
  143. Other correspondences are sometimes preferable since the
  144. PC video hardware expects line drawing characters in certain
  145. font positions.
  146. .LP
  147. Giving a
  148. .I "\-m none"
  149. argument inhibits the loading and activation of a mapping table.
  150. The previous console map can be saved to a file using the
  151. .I "\-om file"
  152. option.
  153. These options of setfont render
  154. .BR mapscrn (8)
  155. obsolete. (However, it may be useful to read that man page.)
  156. .SH "UNICODE FONT MAPS"
  157. The correspondence between the glyphs in the font and
  158. Unicode values is described by a Unicode mapping table.
  159. Many fonts have a Unicode mapping table included in
  160. the font file, and an explicit table can be indicated using
  161. the
  162. .I "\-u"
  163. option. The program
  164. .B setfont
  165. will load such a Unicode mapping table, unless a
  166. .I "\-u none"
  167. argument is given. The previous Unicode mapping table
  168. will be saved as part of the saved font file when the \-O
  169. option is used. It can be saved to a separate file using the
  170. .I "\-ou file"
  171. option.
  172. These options of setfont render
  173. .BR loadunimap (8)
  174. obsolete.
  175. .LP
  176. The Unicode mapping table should assign some glyph to
  177. the `missing character' value U+fffd, otherwise missing
  178. characters are not translated, giving a usually very confusing
  179. result.
  180. Usually no mapping table is needed, and a Unicode mapping table
  181. is already contained in the font (sometimes this is indicated
  182. by the .psfu extension), so that most users need not worry
  183. about the precise meaning and functioning of these mapping tables.
  184. One may add a Unicode mapping table to a psf font using
  185. .BR psfaddtable (1).
  186. .SH OPTIONS
  187. .TP
  188. .BI "\-h " H
  189. Override font height.
  190. .TP
  191. .B \-d
  192. Doubles the size of the font, by replicating all of its pixels
  193. vertically and horizontally. This is suitable for high pixel density
  194. (e.g. "4k") displays on which the standard fonts are too small to be
  195. easily legible. Due to kernel limitations, this is suitable only for
  196. 16x16 or smaller fonts.
  197. .TP
  198. .BI "\-m " file
  199. Load console map or Unicode console map from
  200. .IR file .
  201. .TP
  202. .BI "\-o " file
  203. Save previous font in
  204. .IR file .
  205. .TP
  206. .BI "\-O " file
  207. Save previous font and Unicode map in
  208. .IR file .
  209. .TP
  210. .BI "\-om " file
  211. Store console map in
  212. .IR file .
  213. .TP
  214. .BI "\-ou " file
  215. Save previous Unicode map in
  216. .IR file .
  217. .TP
  218. .BI "\-u " file
  219. Load Unicode table describing the font from
  220. .IR file .
  221. .TP
  222. .BI "\-C " console
  223. Set the font for the indicated console. (May require root permissions.)
  224. .TP
  225. .B \-v
  226. Be verbose.
  227. .TP
  228. .B \-V
  229. Print version and exit.
  230. .SH NOTE
  231. PC video hardware allows one to use the "intensity" bit
  232. either to indicate brightness, or to address 512 (instead of 256)
  233. glyphs in the font. So, if the font has more than 256 glyphs,
  234. the console will be reduced to 8 (instead of 16) colors.
  235. .SH FILES
  236. .TP
  237. .I /share/kbd/consolefonts
  238. The default font directory.
  239. .LP
  240. .TP
  241. .I /share/kbd/unimaps
  242. The default directory for Unicode maps.
  243. .LP
  244. .TP
  245. .I /share/kbd/consoletrans
  246. The default directory for screen mappings.
  247. .LP
  248. The default font is a file
  249. .I default
  250. (or
  251. .IR default8x N
  252. if the \-N option was given for some number N)
  253. perhaps with suitable extension (like .psf).
  254. .SH "SEE ALSO"
  255. .BR psfaddtable (1),
  256. .BR unicode_start (1),
  257. .BR loadunimap (8),
  258. .BR utf-8 (7),
  259. .BR mapscrn (8)
  260. .\" .SH "AUTHORS"
  261. .\" Eugene G. Crosser (crosser@pccross.msk.su)
  262. .\" .br
  263. .\" Andries E. Brouwer (aeb@cwi.nl)