SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from OpenSuSE kbd-2.9.0-lp160.236.2.x86_64.rpm

SETFONT

Section: Maintenance Commands (8)
Updated: 24 October 2024
Index 

NAME

setfont - load EGA/VGA console screen font 

SYNOPSIS

setfont[-Ofont+umap.orig][-ofont.orig][-omcmap.orig][-ouumap.orig][-N][font.new ...][-mcmap][-uumap][-Cconsole][-hH][-f][-v][-V] 

DESCRIPTION

Thesetfontcommand reads a font from the filefont.newand loads it into the EGA/VGA character generator,and optionally outputs the previous font.It can also load various mapping tablesand output the previous versions.

If no args are given (or only the option-Nfor some numberN),then a default(8xN)font is loaded (see below).One may give several small fonts, all containinga Unicode table, andsetfontwill combine them and load the union.Typical use:

setfont
Load a default font.
setfont drdos8x16
Load a given font (here the 448-glyph drdos font).
setfont cybercafe -u cybercafe
Load a given font that does not have a Unicode mapand provide one explicitly.
setfont LatArCyrHeb-19 -m 8859-2
Load a given font (here a 512-glyph font combining severalcharacter sets) and indicate that one's local character setis ISO 8859-2.

Note: if a font has more than 256 glyphs, only 8 out of 16 colorscan be used simultaneously. It can make console perception worse(loss of intensity and even some colors).

 

FONT FORMATS

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 mappingtable 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 ofthe options -8 or -14 or -16 must be used to select one.Raw font files are binary files of size256*Nbytes, containing bit images for each of 256 characters,one byte per scan line, andNbytes per character (0 <N<= 32).Most fonts have a width of 8 bits, but with the framebuffer device (fb)other widths can be used.

 

FONT HEIGHT

The programsetfonthas no built-in knowledge of VGA video modes, but just asksthe kernel to load the character ROM of the video card withcertain bitmaps. However, since Linux 1.3.1 the kernel knowsenough about EGA/VGA video modes to select a different linedistance. The default character height will be the numberNinferred from the font or specified by option. However, theuser can specify a different character heightHusing the-hoption.

 

CONSOLE MAPS

Several mappings are involved in the path from user programoutput to console display. If the console is in utf8 mode (seeunicode_start(1))then the kernel expects that user program output is coded as UTF-8 (seeutf-8(7)),and converts that to Unicode (ucs2).Otherwise, a translation table is used from the 8-bit program outputto 16-bit Unicode values. Such a translation table is called aUnicode console map.There are four of them: three built into the kernel, the fourthsettable using the-moption ofsetfont.An escape sequence chooses between these four tables; after loading acmap,setfontwill output the escape sequence Esc ( K that makes it the active translation.

Suitable arguments for the-moption are for example8859-1,8859-2, ...,8859-15,cp437, ...,cp1250.

Given the Unicode value of the symbol to be displayed, the kernelfinds the right glyph in the font using the Unicode mapping infoof the font and displays it.

Old fonts do not have Unicode mapping info, and in order to handlethem there are direct-to-font maps (also loaded using-m)that give a correspondence between user bytes and font positions.The most common correspondence is the one given in the filetrivial(where user byte values are used directly as font positions).Other correspondences are sometimes preferable since thePC video hardware expects line drawing characters in certainfont positions.

Giving a-m noneargument inhibits the loading and activation of a mapping table.The previous console map can be saved to a file using the-om fileoption.These options of setfont rendermapscrn(8)obsolete. (However, it may be useful to read that man page.)

 

UNICODE FONT MAPS

The correspondence between the glyphs in the font andUnicode values is described by a Unicode mapping table.Many fonts have a Unicode mapping table included inthe font file, and an explicit table can be indicated usingthe-uoption. The programsetfontwill load such a Unicode mapping table, unless a-u noneargument is given. The previous Unicode mapping tablewill be saved as part of the saved font file when the -Ooption is used. It can be saved to a separate file using the-ou fileoption.These options of setfont renderloadunimap(8)obsolete.

The Unicode mapping table should assign some glyph tothe `missing character' value U+fffd, otherwise missingcharacters are not translated, giving a usually very confusingresult.

Usually no mapping table is needed, and a Unicode mapping tableis already contained in the font (sometimes this is indicatedby the .psfu extension), so that most users need not worryabout the precise meaning and functioning of these mapping tables.

One may add a Unicode mapping table to a psf font usingpsfaddtable(1).

 

OPTIONS

-,N/, --default8x=,N/
Load default font(default8xN).
-h,N/, --font-height=,N/
Override font height. The short option must not have a space between the prefixand the number.
-d, --double
Doubles the size of the font, by replicating all of its pixelsvertically and horizontally. This is suitable for high pixel density(e.g. "4k") displays on which the standard fonts are too small to beeasily legible. Due to kernel limitations, this is suitable only for16x16 or smaller fonts.
-o, --output-font=,FILE/
Save previous font inFILE.
-om, --output-consolemap=,FILE/
Store console map inFILE.
-ou, --output-unicodemap=,FILE/
Save previous Unicode map inFILE.
-O, --output-fullfont=,FILE/
Save previous font and Unicode map inFILE.
-m, --consolemap=,FILE/
Load console map or Unicode console map fromFILE.
-u, --unicodemap=,FILE/
Load Unicode table describing the font fromFILE.
-C, --console=,DEVICE/
Set the font for the indicated console. (May require root permissions.)
-f, --force
Force-load unicode map: Setfont`issues the system call to load the unicodemap even if the specified map is empty. This may be useful in unusual cases.
-R, --reset
Reset the screen font, size, and Unicode mapping to the bootup defaults.
-v, --verbose
Be verbose.
-V, --version
Print version and exit.
-h, --help
Print a message describing the options and exit.

 

NOTE

PC video hardware allows one to use the "intensity" biteither 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.

 

FILES

/usr/share/kbd/consolefonts
The default font directory.

/usr/share/kbd/unimaps
The default directory for Unicode maps.

/usr/share/kbd/consoletrans
The default directory for screen mappings.

The default font is a filedefault(ordefault8xNif the -N option was given for some number N)perhaps with suitable extension (like .psf). 

SEE ALSO

psfaddtable(1),unicode_start(1),loadunimap(8),utf-8(7),mapscrn(8)


 

Index

NAME
SYNOPSIS
DESCRIPTION
FONT FORMATS
FONT HEIGHT
CONSOLE MAPS
UNICODE FONT MAPS
OPTIONS
NOTE
FILES
SEE ALSO

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector