Describes terminal driving tables for the nroff command.
The nroff command uses driving tables to customize its output for various types of output devices such as printing terminals, special word-processing terminals (such as Diablo, Qume, or NEC Spinwriter mechanisms), or special output-filter programs. These driving tables are written as ASCII files and are installed in the /usr/share/lib/nterm/tab.Name file, where the Name variable is the name for a terminal type.
The first line of a driving table should contain the name of the terminal, which is simply a string with no imbedded white space (any combination of spaces, tabs, and newline characters). The next part of the driver table is structured as follows:
The meanings of these fields are as follows:
Item | Description |
---|---|
bset | Specifies bits to set in the c_oflag field of the termio structure before output. |
breset | Specifies bits to reset in the c_oflag field of the termio structure before output. |
hor | Specifies horizontal resolution in units of 1/240 of an inch. |
vert | Defines vertical resolution in units of 1/240 of an inch. |
newline | Defines space moved by a new-line (linefeed) character in units of 1/240 of an inch. |
char | Defines a quantum of character sizes, in units of 1/240 of an inch (that is, a character is a multiple of char units wide). |
em | Defines the size of an em space in units of 1/240 of an inch. |
halfline | Defines the amount of space moved by a half-linefeed (or half-reverse-linefeed) character in units of 1/240 of an inch. |
adj | Defines a quantum of white space, in 1/240 of an inch; that
is, white spaces are a multiple of adj units wide. Note: If
this is less than the size of the space character, the nroff command outputs fractional spaces using plot mode. Also, if the -e switch to the nroff command is used, the adj variable is set equal to the hor variable by the nroff command.
|
twinit | Specifies a sequence of characters used to initialize the terminal in a mode suitable for the nroff command. |
twrest | Specifies a sequence of characters used to restore the terminal to normal mode. |
twnl | Specifies a sequence of characters used to move down one line. |
hlr | Specifies a sequence of characters used to move up one-half line. |
hlf | Specifies a sequence of characters used to move down one-half line. |
flr | Specifies a sequence of characters used to move up one line. |
bdon | Specifies a sequence of characters used to turn on hardware boldface mode, if any. |
bdoff | Specifies a sequence of characters used to turn off hardware boldface mode, if any. |
iton | Specifies a sequence of characters used to turn on hardware italics mode, if any. |
itoff | Specifies a sequence of characters used to turn off hardware italics mode, if any. |
ploton | Specifies a sequence of characters used to turn on hardware plot mode (for Diablo-type mechanisms), if any. |
plotoff | Specifies a sequence of characters used to turn off hardware plot mode (for Diablo-type mechanisms), if any. |
up | Specifies a sequence of characters used to move up one resolution unit (vert) in plot mode, if any. |
down | Specifies a sequence of characters used to move down one resolution unit (vert) in plot mode, if any. |
right | Specifies a sequence of characters used to move right one resolution unit (hor) in plot mode, if any. |
left | Specifies a sequence of characters used to move left one resolution unit (hor) in plot mode, if any. |
codeset CodeSetName | Specifies the code set for the particular output device. CodesetName is any valid name for use with the iconv command. The code set defines character entries
within the font description file for the character set section. The
code set field is optional. If used, the code set field must follow
the "left" field and precede the character set section, if provided.
The default is IBM-850. The nroff command uses the specified CodesetName and the code set implied by the current locale to determine if code set conversions are necessary for the input characters. The iconv function is used to perform the code set conversion if necessary. |
This part of the driving table is fixed-format; you cannot change the order of entries. Entries should be on separate lines each containing two fields (no comments allowed) separated by white space; for example:
bset 0
breset 0
Hor 24
Follow this first part of the driving table with a line containing only the word charset, and then specify a table of special characters that you want to include. That is, specify all the non-ASCII characters that the nroff command knows by 2-character names, such as \(hy. If the nroff command does not find the word charset where it expects, it terminates processing with an error message.
Each definition after charset occupies one line and has the following format:
chname width output
The chname field is the (2-letter) name of the special character, the width field is its width in ems, and the output field is the string of characters and escape sequences to send to the terminal to produce the special character.
International Character Support
For fonts for large character sets in which most characters are the same width, as in Japanese, Chinese, and Korean, prototype characters are provided for the character set section of the nterm table. These prototype characters specify the width of characters of varying byte lengths. The code field for prototype character entries must contain a single ? (question mark). The prototype character entries apply to all characters not explicitly defined on their own in the character set section. It is assumed the output device code for characters handled via prototype characters is the same as the input code for characters (with possible codeset conversions). The following are the prototype character definitions:
X1 Width ? Represents the width of all one-byte characters not defined elsewhere.
X2 Width ? Represents the width of all two-byte characters not defined elsewhere.
X3 Width ? Represents the width of all three-byte characters not defined elsewhere.
X4 Width ? Represents the width of all four-byte characters not defined elsewhere.
If any field in the charset part of the driving table does not pertain to the output device, you can give that particular sequence as a null string or leave out the entry. Special characters that do not have a definition in this file are ignored on output by the nroff command.
You can put the charset definitions in any order, so it is possible to speed up the nroff command by putting the most used characters first. For example:
charset
em 1-
hy 1-
\-1-
bu 1 +\bo
The best way to create a terminal table for a new device is to take an existing terminal table and edit it to suit your needs. Once you create such a file, put it in the /usr/share/lib/nterm directory. Then, give it the name tab.xyz, where the xyz variable is the name of the terminal and also the name that you pass the nroff command by way of the -T flag. For example:
nroff -Txyz
Item | Description |
---|---|
/usr/share/lib/nterm/tab.Name | Contains terminal files. |