[net.unix-wizards] Alternate Troff Output Query

rbk@sri-unix (11/19/82)

Does anyone out there in net land have a way to run troff to a Integral
Data Systems printer?  If not, does anyone have any specification on
the output formats (standard output) that "troff -t" generates, so we
could build an interpreter?  Is it even reasonable to consider building
such an interpreter?  Thanks in advance for any information!

					Bob Beck
					Intel Corp
					...hplabs!intelqa!omsvax!rbk

greep@Su-Dsn@sri-unix (11/24/82)

Date: Monday, 22 Nov 1982 22:46-PST
The usual method, if you have Berkeley Unix, is to look at vcat and
scavenge as much of that as possible.  You are probably better off running
the new device-independent troff.

rlb@Purdue@sri-unix (11/24/82)

From: Bob Brown <rlb@Purdue>
Date: 22 Nov 1982 22:25:16-EST
For all you old-troff hackers, I'm submitting the following manual
page (we call it ptl.5, not "praise the lord").  It was written
at Purdue-CS by Eric Dittert after he was forced to repair our
versatec phototypesetter in order to complete his thesis.  Pay
particular attention to the "bugs" section.

Bob Brown
------------------------------------------------------------------
 .PU
 .TH PTL 5
 .SH NAME
ptl \- phototypesetter language; (\fItroff\fR output/\fIvcat\fR input)
 .SH DESCRIPTION
Each byte of the \fItroff\fR output file is a command to the phototypesetter.
The following is a summary of the phototypesetter instructions.
 .sp 1
 .ft B
\h'2n'Command_Byte  \h'|0.5i+15n'Meaning
 .ft R
 .RS 0.5i
 .IP "000  :" 15n
No-op.
 .IP "001-077  :" 15n
Print an ASCII character.
 .br
The character to be printed is determined by using the command_byte
(if \fIcase\fR is currently LOWER) or command_byte+64 (if \fIcase\fR is
currently UPPER) as an index into a table, the entries in which do not seem
to be ordered in any describable way.
 .IP "0100  :" 15n
Initialize.
 .br
This includes setting the modes as follows: \fIcase\fR=LOWER,
\fIhorizontal\fR=LEFT, \fIvertical\fR=DOWN, \fIfont\fR=0.
It does not change \fIpointsize\fR.
 .IP "0101-0104  :" 15n
Select font.
 .br
The phototypesetter (and hence, \fIvcat\fR) can handle four fonts,
numbered 0, 1, 2, and 3.  Consider the current font number, \fIfont\fR, as
a two-bit value.  The command 0101 resets bit 0, 0102 sets bit 0, 0103 sets
bit 1, and 0104 resets bit 1.  (And yes, we have already sent this one in to
Ripley.)
 .IP "0105  :" 15n
Set \fIcase\fR to LOWER.
 .IP "0106  :" 15n
Set \fIcase\fR to UPPER.
 .IP "0107  :" 15n
Set \fIhorizontal\fR to LEFT.
 .IP "0110  :" 15n
Set \fIhorizontal\fR to RIGHT.
 .IP "0111  :" 15n
Halt.
 .IP "0112  :" 15n
Set \fIvertical\fR to DOWN.
 .IP "0113  :" 15n
Undefined (no-op).
 .IP "0114  :" 15n
Set \fIvertical\fR to UP.
 .IP "0115  :" 15n
Formfeed.
 .br
(Added for the Versatec.)
 .IP "0116,0117  :" 15n
Undefined (no-op).
 .IP "0120-0137  :" 15n
Set point size.
 .br
The new value of \fIpointsize\fR is command_byte - 0120.
 .IP "0140-0177  :" 15n
Move vertically (lead).
 .br
The number of units to move is 0177 - command_byte.
The direction is determined by the current value of \fIvertical\fR.
 .IP "0200-0377  :" 15n
Move horizontally (escape).
 .br
The number of units to move is 0377 - command_byte.
The direction is determined by the current value of \fIhorizontal\fR.
 .RE
 .sp 1
Notes:
 .RS
 .IP 1) 0.25i
Being a single byte, each motion instruction can only specify a relatively
small number of units to move (037(oct) = 31(dec) units vertically;
0177(oct) = 127(dec) units horizontally).
Hence, it is not uncommon to see lengthy strings of similar motion commands
in \fItroff\fR output.
 .IP 2) 0.25i
The units for horizontal and vertical motion are \fItroff\fR basic units
(432 units = 1 inch).
 .IP 3) 0.25i
"Print character" instructions do not cause any horizontal or vertical
motion.
Therefore, the instructions for printing two adjacent characters are separated
by a horizontal motion command.
 .IP 3) 0.25i
There is no "new line" instruction; so, in order to avoid large numbers of
horizontal motion commands, every other line of text is reversed.
 .IP 4) 0.25i
The mode variables \fIcase\fR, \fIhorizontal\fR, \fIvertical\fR, \fIfont\fR,
and \fIpointsize\fR appear in \fIvcat\fR as \fImcase\fR, \fIback\fR,
\fIverd\fR, \fIrailmag\fR, and \fIcpsize\fR, respectively.
 .RS
 .SH SEE ALSO
pti(1), troff(1), vpr(1)
 .SH BUGS
If you are this deeply into the \fIvtroff\fR scene, you should be rewriting
\fItroff\fR for the Versatec instead of wasting time reading manual pages.

thomas (11/24/82)

Please note that the 8 font CAT's seem to use 116 and 117 (or is it 115 and
116) to flip the third bit in the font number back and forth.  This bit me
when I tried to use vcat to process Scribe(tm) output.
=Spencer

ron@Brl@sri-unix (11/25/82)

From:     Ron Natalie <ron@Brl>
Date:     23 Nov 82 2:12:12-EST (Tue)
Troff -t to IDS printer:

There is a guy at JHU named George Toth who wrote an output filter
that takes the CAT typesetter codes (from troff -t) and goes to the
versatec (this has been done other places, such as vcat at UofToronto).
His mail address is ...!brl-bmd!jhu!crw_rget

However!  If you are talking about the IDS IP-125 or 225 "Brighter
Writer" in it's so called graphics mode...FORGET IT.  We were thinking
about doing it and it is useless.  First...resolution is poor.  Second,
their is no way to generate constant spacing on the stupid thing.  Since
an octal 003 will take you out of graphics mode unless you place another
octal 003 after it, and a double 003 causes a glitch in the output, plotting
is not so hot .  What you really want to do is to fix up a nice terminal
description for nroff for the thing.

Note:  the thing also has the problem that it uses CTS for flow control,
but if you hit the right margin, it drops clear-to-send and then waits
for you to send a carriage return.  If you honor the CTS protocal you just
sit there and wait forever.

-Ron