[net.text] Diablo Driver Tables

rlh@ukc.UUCP (R.L.Hellier) (02/22/84)

	Does anyone have nroff device tables ( term??? ) for the
	following devices please,

		Diablo 630

		Qume Daisyprinter 3/45 WP

	I gather the Diablo is a fairly recent model but does
	not seem to be backwards compatible with previous models
	for which there are device tables.

		Any help gratefully received,

-- 
				Richard Hellier

				rlh@ukc.UUCP
				...!vax135!!ukc!rlh

fair@dual.UUCP (Erik E. Fair) (02/28/84)

How does one construct a driver table, anyway? Can someone tell me?


	Erik E. Fair

	dual!fair@BERKELEY.ARPA
	{ihnp4,ucbvax,cbosgd,decwrl,amd70,fortune,zehntel}!dual!fair
	Dual Systems Corporation, Berkeley, California

guy@rlgvax.UUCP (Guy Harris) (02/29/84)

Here's how to construct a driver table for USG UNIX "nroff", in 25 easy lessons.
The only changes for the V7 nroff (on 4.xBSD as well) are that the "iton" and
"itoff" entries are missing, the "bset" and "breset" entries affect the
"sg_flags" word in the "sgtty" structure, and the procedures for making
the table are different.

Special thanks to the people at AT&T responsible for the UNIX documentation,
without whose help this posting would not have been necessary.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy

-----------------------------Guy Harris-----------------------------------------
.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.
.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)