nroff driver table info wanted
Guy Harris
guy at rlgvax.UUCP
Tue Feb 19 08:46:14 AEST 1985
Here comes the latest posting of a manual page for NROFF driver tables.
If you think you might someday possibly perhaps want to work with such
a table, or even if you think a friend might..., save this article.
This page pertains to the System III version of NROFF (and the System V
Release 1 version; NROFF got moved into the Documenter's Workbench
package and out of the core of UNIX in S5R2, but it probably still
applies). For the V7 version (which comes with BSD releases as well),
make the following changes:
For "'c_oflag'" field of the 'termio' structure", read "'sg_flags' field
of the 'sgtty' structure".
Ignore the "iton" and "itoff" strings; they do not exist in that version.
Ignore the instructions on how to remake the driver table. (Also ignore
them if you have S3/S5 but don't have source, and your vendor hasn't provided
a way to make driver tables. If that's the case, you're out of luck.)
Guy Harris
{seismo,ihnp4,allegra}!rlgvax!guy
-------------------------------Cut Here-----------------------------------------
.TH TERM 5
.SH NAME
term \- terminal driving tables for nroff
.SH DESCRIPTION
.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
\f3/usr/lib/term/tab\f2name\fP ,
where
.I name\^
is the name for that terminal type as given in
.IR term (7).
The structure of the tables is as follows:
.PP
.nf
.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 *iton;
char *itoff;
char *ploton;
char *plotoff;
char *up;
char *down;
char *right;
char *left;
char *codetab[256\-32];
char *zzz;
} t;
.fi
.DT
.PP
The meanings of the various fields are as follows:
.TP 10
.I bset\^
bits to set in the
.I c_oflag\^
field of the
.I termio\^
structure (see
.IR tty (4))
before output.
.TP 10
.I breset\^
bits to reset in the
.I c_oflag\^
field of the
.I termio\^
structure
before output.
.TP 10
.I Hor\^
horizontal resolution in fractions of an inch.
.TP 10
.I Vert\^
vertical resolution in fractions of an inch.
.TP 10
.I Newline\^
space moved by a newline (linefeed) character in fractions
of an inch.
.TP 10
.I Char\^
quantum of character sizes, in fractions of an inch.
(i.e., a character is a multiple of Char units wide)
.TP 10
.I Em\^
size of an em in fractions of an inch.
.TP 10
.I Halfline\^
space moved by a half-linefeed (or half-reverse-linefeed)
character in fractions of an inch.
.TP 10
.I Adj\^
quantum of white space, in fractions of an inch.
(i.e., white spaces are a multiple of Adj units wide)
.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),
.I nroff\^
will output
fractional spaces using plot mode. Also, if the
.B \-e
switch to
.I nroff\^
is used, Adj is set equal to Hor by
.IR nroff .
.TP 10
.I twinit\^
set of characters used to initialize the terminal
in a mode suitable for
.IR nroff .
.TP 10
.I twrest\^
set of characters used to restore the terminal to
normal mode.
.TP 10
.I twnl\^
set of characters used to move down one line.
.TP 10
.I hlr\^
set of characters used to move up one-half line.
.TP 10
.I hlf\^
set of characters used to move down one-half line.
.TP 10
.I flr\^
set of characters used to move up one line.
.TP 10
.I bdon\^
set of characters used to turn on hardware boldface mode,
if any.
.I Nroff\^
assumes that boldface mode is reset automatically by the
.I twnl\^
string, because many letter-quality printers reset the boldface
mode when they receive a carriage return;
the
.I twnl\^
string should include whatever characters are necessary to
reset the boldface mode.
.TP 10
.I bdoff\^
set of characters used to turn off hardware boldface mode,
if any.
.TP 10
.I iton\^
set of characters used to turn on hardware italics mode,
if any.
.TP 10
.I itoff\^
set of characters used to turn off hardware italics mode,
if any.
.TP 10
.I ploton\^
set of characters used to turn on hardware plot mode
(for Diablo type mechanisms), if any.
.TP 10
.I plotoff\^
set of characters used to turn off hardware plot mode
(for Diablo type mechanisms), if any.
.TP 10
.I up\^
set of characters used to move up one resolution unit
(Vert) in plot mode, if any.
.TP 10
.I down\^
set of characters used to move down one resolution unit
(Vert) in plot mode, if any.
.TP 10
.I right\^
set of characters used to move right one resolution unit
(Hor) in plot mode, if any.
.TP 10
.I left\^
set of characters used to move left one resolution unit
(Hor) in plot mode, if any.
.TP 10
.I codetab\^
definition of characters needed to print an
.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:
.RS
.IP "0100 bit on" 15
vertical motion.
.IP "0100 bit off" 15
horizontal motion.
.IP "040 bit on" 15
negative (up or left) motion.
.IP "040 bit off" 15
positive (down or right) motion.
.IP "037 bits" 15
number of such motions to make.
.RE
.TP 10
.I zzz\^
a zero terminator at the end.
.PP
All quantities which are in units of fractions of an inch should
be expressed as
.RI INCH* num / denom ,
where
.I num\^
and
.I denom\^
are respectively the numerator and denominator of the fraction; i.e.,
1/48 of an inch would be written as ``INCH/48''.
.PP
If any sequence of characters does not pertain to the output device,
that sequence should be given as a null string.
.PP
The source code for the terminal
.I name\^
is in
.BI /usr/src/cmd/text/roff.d/terms.d/tab name .c.
When a new terminal type is added, the file
.I maketerms.c\^
should be updated to `#include' the source to that driving table;
note that the various terminal types are grouped into ``parts'' labelled
.BR PART1 ,
.BR PART2 ,
and
.BR PART3 .
If necessary, more parts can be added. Other changes necessary to
.I maketerms.c\^
are left as an exercise to the reader.
The makefile
.I terms.mk\^
in that directory should then be updated.
.SH FILES
/usr/lib/term/tab\f2name\fP driving tables
.br
tab\f2name\fP.c source for driving tables
.SH SEE ALSO
troff(1), term(7)
More information about the Comp.unix.wizards
mailing list