[net.sources] V7/[24].?BSD man page for nroff terminal driving tables

guy@rlgvax.UUCP (Guy Harris) (10/17/83)

: Run this shell script with "sh" not "csh"
PATH=:/bin:/usr/bin:/usr/ucb
export PATH
all=FALSE
if [ $1x = -ax ]; then
	all=TRUE
fi
/bin/echo 'Extracting term.5'
sed 's/^X//' <<'//go.sysin dd *' >term.5
X.TH TERM 5
X.SH NAME
term \- terminal driving tables for nroff
X.SH DESCRIPTION
X.IR Nroff (1)
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 C programs, compiled, and installed in
X.BR /usr/lib/term/tab\fIname ,
where
X.I name
is the name for that terminal type as given in
X.IR term (7).
The structure of the tables is as follows:
X.PP
X.nf
X.ta 5m 10m 15m 20m 25m 30m 35m 40m 45m 50m 55m 60m
#define	INCH	240

struct {
	int bset;
	int breset;
	int Hor;
	int Vert;
	int Newline;
	int Char;
	int Em;
	int Halfline;
	int Adj;
	char *twinit;
	char *twrest;
	char *twnl;
	char *hlr;
	char *hlf;
	char *flr;
	char *bdon;
	char *bdoff;
	char *ploton;
	char *plotoff;
	char *up;
	char *down;
	char *right;
	char *left;
	char *codetab[256\-32];
	int zzz;
} t;
X.fi
X.DT
X.PP
The meanings of the various fields are as follows:
X.TP 10
X.I bset
bits to set with an
X.IR stty (2)
before output.
X.TP 10
X.I breset
bits to reset with an
X.I stty
before output.
X.TP 10
X.I Hor
horizontal resolution in fractions of an inch.
X.TP 10
X.I Vert
vertical resolution in fractions of an inch.
X.TP 10
X.I Newline
space moved by a newline (linefeed) character in fractions
of an inch.
X.TP 10
X.I Char
quantum of character sizes, in fractions of an inch.
(i.e., a character is a multiple of Char units wide)
X.TP 10
X.I Em
size of an em in fractions of an inch.
X.TP 10
X.I Halfline
space moved by a half-linefeed (or half-reverse-linefeed)
character in fractions of an inch.
X.TP 10
X.I Adj
quantum of white space, in fractions of an inch.
(i.e., white spaces are a multiple of Adj units wide)
X.IP
Note: if this is less than the size of the space
character (in units of Char; see below for how the
sizes of characters are defined),
X.I nroff
will output
fractional spaces using plot mode.  Also, if the
X.B \-e
switch to
X.I nroff
is used, Adj is set equal to Hor by
X.IR nroff .
X.TP 10
X.I twinit
set of characters used to initialize the terminal
in a mode suitable for
X.IR nroff .
X.TP 10
X.I twrest
set of characters used to restore the terminal to
normal mode.
X.TP 10
X.I twnl
set of characters used to move down one line.
X.TP 10
X.I hlr
set of characters used to move up one-half line.
X.TP 10
X.I hlf
set of characters used to move down one-half line.
X.TP 10
X.I flr
set of characters used to move up one line.
X.TP 10
X.I bdon
set of characters used to turn on hardware boldface mode,
if any.
X.I Nroff
assumes that boldface mode is reset automatically by the
X.I twnl
string, because many letter-quality printers reset the boldface
mode when they receive a carriage return;
the
X.I twnl
string should include whatever characters are necessary to
reset the boldface mode.
X.TP 10
X.I bdoff
set of characters used to turn off hardware boldface mode,
if any.
X.TP 10
X.I ploton
set of characters used to turn on hardware plot mode
(for Diablo type mechanisms), if any.
X.TP 10
X.I plotoff
set of characters used to turn off hardware plot mode
(for Diablo type mechanisms), if any.
X.TP 10
X.I up
set of characters used to move up one resolution unit
(Vert) in plot mode, if any.
X.TP 10
X.I down
set of characters used to move down one resolution unit
(Vert) in plot mode, if any.
X.TP 10
X.I right
set of characters used to move right one resolution unit
(Hor) in plot mode, if any.
X.TP 10
X.I left
set of characters used to move left one resolution unit
(Hor) in plot mode, if any.
X.TP 10
X.I codetab
definition of characters needed to print an
X.I nroff
character
on the terminal.
The first byte is the number of character units (Char) needed to hold the
character; i.e., ``\\001'' is one unit wide, ``\\002'' is two
units wide, etc.  The high-order bit (0200) is on if
the character is to be underlined in underline mode
(.ul).
The rest of the bytes are the characters used to produce the character in
question.  If the character has the sign (0200) bit on,
it is a code to move the terminal in plot mode.  It is
encoded as:
X.RS
X.IP "0100 bit on" 15
vertical motion.
X.IP "0100 bit off" 15
horizontal motion.
X.IP "040 bit on" 15
negative (up or left) motion.
X.IP "040 bit off" 15
positive (down or right) motion.
X.IP "037 bits" 15
number of such motions to make.
X.RE
X.TP 10
X.I zzz
a zero terminator at the end.
X.PP
All quantities which are in units of fractions of an inch should
be expressed as
X.RI INCH* num / denom ,
where
X.I num
and
X.I denom
are respectively the numerator and denominator of the fraction; i.e.,
1/48 of an inch would be written as ``INCH/48''.
X.PP
If any sequence of characters does not pertain to the output device,
that sequence should be given as a null string.
X.PP
The source code for the terminal
X.I name
is in
X.BI /usr/src/cmd/troff/term/tab name .c.
When a new terminal type is added, the
X.I makefile
in that directory should be updated.
X.SH FILES
X/usr/lib/term/tab\fIname\fR	driving tables
X.br
tab\fIname\fR.c	source for driving tables
X.SH SEE ALSO
troff(1), term(7)
//go.sysin dd *
made=TRUE
if [ $all = TRUE ]; then
	/bin/echo '	Changing owner to "bin"'
	/etc/chown bin term.5
else
	/bin/echo '	Original owner was "bin"'
fi
if [ $made = TRUE ]; then
	/bin/chmod 644 term.5
	/bin/echo -n '	'; /bin/ls -ld term.5
fi