troff, C/A/T and dvi ?

Chris Lewis clewis at eci386.uucp
Fri Jul 20 05:48:05 AEST 1990


In article <13360 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
> In article <STEF.90Jul12181552 at zweig.sun> stef at zweig.sun (Stephane Payrard) writes:
> >Where I can find a complete definition of the C/A/T format?
 
> Presumably you would have to get the C/A/T programmer's manual from Wang.
> Somebody (possibly Henry Spencer) once posted a UNIX manual entry that
> described the format sufficiently for use in designing otroff postprocessors.

Yes, Henry Spencer wrote cat(5).  It's what I used to build psroff.
(which can generate postscript, HPLJ PCL or ditroff codes).
Henry's man page isn't complete (it doesn't have the FLASH code to
actual glyph correspondances - which is semi-hard to find out without
troff sources), but is more than enough to get you started.  There is
also a section in Sun's docs "Using NROFF and TROFF" (pn 800-1755-10,
Rev A, 1988 Appendix E) which has the same information.
cat(5) is included in psroff 1.0.  Psroff 2.0 (in comp.sources.unix
when Rich gets back from vacation) has cat(5) plus a source file with
the precise FLASH correspondances (and width table indexes).  If you
can't find them somewhere else, send me mail and I'll send you cat(5)
and cattab.c.

> If you need to adapt troff to some new device, I highly recommend starting
> with modern troff as found in the Documenter's WorkBench package (also
> sold with enhancements by various third-party VARs).

To clarify a bit.... modern troff is capable of much better printer
independence than CAT troff, and has considerably more features
(such as line drawing, and extensible character set).  Therefore,
to support a new printer, you should implement a "DITROFF format
(as opposed to CAT format)-to-your-printer" converter.  You will
also need to find a way to build the ditroff width tables for
your printer.  Ditroff format is somewhat easier to handle than C/A/T.
(at least to a first approximation - at least it's ASCII ;-)

HOWEVER, almost all ditroffs cost money, and you may not have one.
Almost all UNIXs come with a cheap (or bundled in) CAT Troff.
In such a case, *still* build your printer stuff to handle
ditroff, and use psroff (or "cat2dit") to generate ditroff
format from CAT Troff.

Doing it this way (using ditroff input) gives you the best of both
worlds - all ditroff owners can use your software directly, and CAT
troff owners can use your driver with psroff generating ditroff from
CAT troff.  Building your driver to accept C/A/T codes would be
a bit pointless - ditroff users could never use it (only an insane
person would convert ditroff format to CAT format).
-- 
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list



More information about the Comp.unix.questions mailing list