[Previous] [Contents] [Next]


Load text-mode font data into EGA or VGA cards (QNX)


cfont [-f font_number] [-r rows | -s scanlines] font_file


-f font_number
Load the font description into this font position (where font_number is a number from 0 to 3). If -f is omitted, the next free font slot is selected.
-r rows
Support this number of screen rows on the console.
-s scanlines
Support this number of scanlines for every character in the font.
The name of a file containing a font description.


The cfont utility loads text-character font data into the text-mode console device driver for EGA or VGA display cards. Up to four fonts can be programmed into the driver, each occupying a font "slot" (font_number). Fonts can have a variety of typefaces, sizes, and styles (e.g. italics, bold, sanserif, upside-down), and using them may result in more than 25 active lines per screen. For cfont to work, the Dev manager and the console driver (Dev.ansi or Dev.con) must be running.

VGA character modes (with 400 scanlines per screen) support font sizes up to 16 scanlines per character, while EGA character modes (with 350 scanlines per screen) support font sizes up to 14 scanlines per character.

The cfont utility automatically determines how many scanlines per character the font definition describes by inspecting the size of the font_file. From this, the number of rows on the console is determined.

To override the default number of scanlines used by each character, use either -r or -s. For example, the shipped sanserif font is 14 scanlines high. Specifying -s 15 would add an extra scanline to each row of characters, resulting in fewer rows being displayed. However, if -s 13 was specified, the last scanline of each character would be discarded, resulting in more rows being displayed. Note that with many fonts the last scanline is white space, so decreasing the number of scanlines per character by 1 brings rows closer together but doesn't crop any characters.

The size of a font can also be changed with the -r option. Note, however, that it is an error to specify both -r and -s at the same time. The two options are related as follows:

rows = 400 / scanlines rows = 350 / scanlines
scanlines = 400 / rows scanlines = 350 / rows

Font files without absolute pathnames are searched for first in the current directory and then in the /etc/config/cfont directory. Several font varieties and sizes are included in this directory.


Load the sanserif font description into system font position 0. This results in 28 lines per screen when displaying font 0 on a VGA monitor:

cfont -f0 sanserif.14


The cfont utility reads fonts from binary font files named on the command line. Font filenames which do not begin with a / will be looked for in the /etc/config/cfont directory.

Exit status:

font was loaded successfully
an error occurred

See also:

Dev, Dev.ansi, Dev.con

[Previous] [Contents] [Next]