[comp.text] nroff drivers

c.steinb@cooper.UUCP (03/23/87)

Can anyone tell me how to write a terminal driver for NROFF?

c.steinb@cooper.UUCP

mangler@cit-vax.UUCP (04/03/87)

In article <799@cooper.UUCP>, c.steinb@cooper.UUCP (Craig Steinberger ) writes:
> Can anyone tell me how to write a terminal driver for NROFF?

An nroff driver table is an a.out, which nroff links in at run time.
It contains one struct, defined in /usr/src/*/troff/tw.h, which has
a bunch of ints describing the resolution of the terminal, and
pointers to strings for all the necessary character sequences.

The ints are all measured in nroff units, 240 per inch.

"codetab" is an array of pointers to the sequences used to print each
of the 224 nroff characters.  The first 95 of these are the printable
ASCII characters.  The first byte of each string is the width of the
glyph, in Chars (see tw.h).  Setting the 0200 bit means it's ok to
underline.  The remaining characters are output literally if ASCII;
non-ASCII bytes (i.e. with 0200 bit set) represent fine-positioning:
	0200 + N    move right by N plot-mode units
	0240 + N    move left by N
	0300 + N    move down by N
	0340 + N    move up by N
This uses plot mode, to give more flexibility in overstriking than
is possible with just backspace, half-line-up, and half-line-down.
On a Diablo-style printer it is possible to build up readable glyphs
for nearly the entire troff character set.  (The Spinwriter was lotsa
fun to watch when printing fancy things like copyright symbols).  If
all else fails, you can do dot-matrix, though it tends to wear out
the period pretty fast.

I could send you a spiffy Spinwriter 5525 driver table which I wrote in
1981 (I assume it's still public domain), but you'll need an AT&T Unix
source license for tw.h.

Don Speck   speck@vlsi.caltech.edu  {seismo,rutgers,ames}!cit-vax!speck

patwood@unirot.UUCP (04/04/87)

Sorry, but an nroff driver table is not an "a.out".  In versions of nroff
before DWB 2.0, it is a binary file, but not in a.out format.  Nroff reads
this file (doesn't link or load it) into its internal data structures when
it starts up.  In DWB 2.0, there is a dinroff (device independent nroff)
that reads an ASCII file containing basically the same information that
was present in the old nroffs' binary file.  Note that the actual operation
of nroff wasn't changed in DWB 2.0; it's simply easier to write driver tables
for it now.

Pat Wood
bellcore!phw5!phw

mangler@cit-vax.UUCP (04/12/87)

In article <482@unirot.UUCP>, patwood@unirot.UUCP (Patrick Wood) writes:
> Sorry, but an nroff driver table is not an "a.out".

Sigh, another USG difference.  I should have identified the environment.
On 4.2 BSD and 4.3 BSD, the command "file /usr/lib/term/tab*" identifies
them all as "executable".  (IS/1 on VMS used PDP-11 a.out's)!

> Nroff reads this file (doesn't link or load it) into its internal data
> structures

and it adds the new base address to each string pointer, like a linker.

Don Speck   speck@vlsi.caltech.edu  {seismo,rutgers,ames}!cit-vax!speck

cck@deneb.ucdavis.edu (Earl H. Kinmonth) (08/16/89)

The good news:

In a world of software ripoffs, there are two companies (in my
experience) that generally give you good or very good value for your
money: SCO and MKS.

The bad news:

Even saints don't do it right all of the time.

The problem:

SCO troff and nroff come with drivers for nifty devices like the CAT
photo typesetter and the model 33 Teletype. Unfortunately, I do not
have access to the Smithsonian Institution, where I presume such
devices can be found. I kicked and screamed when they (the Computer
Center) pulled the O-27 key-punch out from under me, but I lost the
battle.

Here in Davis, in that jerkwater institution known as the University of
California, I have access only to such primitive devices as Xerox and
Hewlett Packard laser printers, HP Think and Quiet Jets, Epson,
Panasonic, and NEC (gawd, don't those names sound foreign and
subversive!) dot-matrix machines, etc.

While I realize that wanting to use SCO nroff with a laser printer is
rather like using Old Glory in lieu of charcoal starter for a White
House barbeque, I also suspect there must be a few other pinko,
subversives out there, who might not only have had the same wish, but
who have actually realized their carnal desires. Maybe there are even a
few real weirdos who have drivers for Epson, Panasonic, NEC, etc.,
printers, the same way there are a few nuts who drive Toyotas, Nissans,
Hondas, etc.

Is there any chance you might share your perverted "drivers" with me?

(I'm only interested in true hard core -- something that works with the
-e option and plot mode. Sneaking looks at Playboy when I was a
teenager taught me how to handle softcore. I want the real thing!)

Rhetorical question:

Should I keep my copy of SCO (classic) troff in the hope that
collecting quaint, but otherwise useless software, achieves the cult
status (and value) of first edition comic books, green-tinted cut
class, useless farm implements, or any other of the high-priced
{junk|artifacts} one can find in "antique" shops along Cal 49 in the
Gold Country?

Earl H. Kinmonth
History Department
University of California, Davis
916-752-1636 (voice, fax [2300-0800 PDT])
916-752-0776 secretary

(bitnet) ehkinmonth@ucdavis.edu
(uucp) ucbvax!ucdavis!ucdked!cck
(telnet or 916-752-7920) cc-dnet.ucdavis.edu [128.120.2.251]
	request ucdked, login as guest,
	no password

tpf@jdyx.UUCP (Tom Friedel) (08/16/89)

cck@deneb.ucdavis.edu (Earl H. Kinmonth) writes:

>Should I keep my copy of SCO (classic) troff in the hope that
>...

troff as shipped by AT&T these days is really ditroff (device independent
troff)  If you can afford one of the fancy packages like Adobe's 
transcript, you will be able to use that postscript laser printer as
effortlessly as lp filename to print text as well as roff ;  

Tom
-- 
Tom Friedel             Public Access Unix BBS
tpf@prism.gatech.edu    ...gatech!emory!jdyx!tpf          
(404) 320-7624          (404) 321-5020                  

randy@chinet.chi.il.us (Randy Suess) (08/17/89)

In article <1989Aug16.123946.25811@jdyx.UUCP> tpf@jdyx.UUCP (Tom Friedel) writes:
]troff as shipped by AT&T these days is really ditroff (device independent
]troff)  If you can afford one of the fancy packages like Adobe's 
]transcript, you will be able to use that postscript laser printer as
]effortlessly as lp filename to print text as well as roff ;  

	Even better for Laserjet or DeskJet people is jetroff.
	Includes lotsa fonts, and support for tif and .pcx pictures.
	Complete source is $50 for personal use.  Contact jetroff@pcrat.uucp
	for info.

	Not affiliated, just a satisfied user.
	-randy
-- 
Randy Suess
randy@chinet.chi.il.us

davidsen@sungod.crd.ge.com (ody) (08/17/89)

In article <5134@ucdavis.ucdavis.edu> cck@deneb.ucdavis.edu (Earl H. Kinmonth) writes:

| SCO troff and nroff come with drivers for nifty devices like the CAT
| photo typesetter and the model 33 Teletype. Unfortunately, I do not
| have access to the Smithsonian Institution, where I presume such
| devices can be found. I kicked and screamed when they (the Computer
| Center) pulled the O-27 key-punch out from under me, but I lost the
| battle.
| 
| Here in Davis, in that jerkwater institution known as the University of
| California, I have access only to such primitive devices as Xerox and
| Hewlett Packard laser printers, HP Think and Quiet Jets, Epson,
| Panasonic, and NEC (gawd, don't those names sound foreign and
| subversive!) dot-matrix machines, etc.

  Well if you ever get to the level of PostScript you could use the
troff driver for that. Nah! Too easy. Besides, you'd need the sarcasm
filter to keep from clogging the spaces between the bits.

  Seriously:
	tbl mydoc.n | troff -t -ms | thack | lpr -dlw
	bill davidsen		(davidsen@crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

clewis@eci386.uucp (Chris Lewis) (08/23/89)

In article <5134@ucdavis.ucdavis.edu> cck@deneb.ucdavis.edu (Earl H. Kinmonth) writes:
>The problem:

>SCO troff and nroff come with drivers for nifty devices like the CAT
>photo typesetter and the model 33 Teletype. Unfortunately, I do not
>have access to the Smithsonian Institution, where I presume such
>devices can be found....

>Rhetorical question:

>Should I keep my copy of SCO (classic) troff in the hope that
>collecting quaint, but otherwise useless software, achieves the cult
>status (and value) of first edition comic books, green-tinted cut
>class, useless farm implements, or any other of the high-priced
>{junk|artifacts} one can find in "antique" shops along Cal 49 in the
>Gold Country?

Actually, no.  classic troff is quite useful.  See point (3) below.

This is your alternatives I've garnered from experience and playing around 
with such things:

	1) Get ditroff (couple hundred bucks) and search around for
	   some drivers.  One driver of particular fame and excellence
	   is Rick Richardson's "jettroff", which takes ditroff input
	   and produces hplj output.  I've seen some of its output,
	   and it is just about as good as you can get on a 300 dpi
	   laser (even a postscript one).  Rick sells a supported
	   version of jetroff for about $50 (different pricing for
	   commercial environments) which includes fonts.

	   This is some of Rick's contact info:

		PC Research, Inc.
		94 Apple Orchard Drive
		Tinton Falls, NJ   07724

		(201) 389-8963

	   There is a shareware version available via anon uucp.
	   I won't post Rick's blurb because it's kinda large, it's
	   probably out of date, and I'll get flamed for commercial
	   advertising.  It might be a good time for him to post it, 
	   or at least readvertise its existance and how to get it.

	2) If you have a postscript printer, obtain ditroff and a copy
	   of tpscript (from comp.sources.unix archives, issues v15i013-017
	   I think).  tpscript is a PD ditroff->postscript converter.
	   tpscript is an excellent package.

	3) H'mm, you can't afford ditroff, let alone a postscript printer.
	   Well, have I got a solution for you:

	    1) In the queue on comp.sources.unix is "psroff", a back-end
	       for classic CAT Troff, which will generates ditroff,
	       postscript and HPLJ codes.  Works very well.  It should,
	       I wrote it ;-)  We've been using it quite heavily in production
	       (technical reports, memos, and some pretty fancy publishing)
	       for about 8 months.

	    2) If you have a HPLJ-compatible printer, I would not particularly
	       recommend psroff's HPLJ's driver, because it doesn't know about
	       font downloading yet (hopefully some kind soul out there will 
	       help me implement true font support into the HPLJ driver).  
	       Though, if you have all of the fonts and sizes you need on a 
	       floppy or a cartridge, psroff will drive a hplj just fine.

	       However, if you use jetroff as the back-back-end, and psroff 
	       generating ditroff output, you've got full blown troff capability
	       typesetting.
	    
	    3) If you have a postscript printer, psroff works very well.
	       Alternately, you can use psroff ditroff output with tpscript.
	       (though, there shouldn't be much difference - I stole a bit
	       from it).
	
	    4) The only problem with CAT->something filters, however, is
	       you don't get some of the new ditroff features, like
	       generalized drawing, eg: I don't think either pic or grap
	       would work, but the only way to get them is to get ditroff
	       anyhow.

	4) There are other CAT->something filters, but they either ain't
	   free (by a substantial margin) or they aren't as good as psroff.
	   (natch ;-)

	5) I keep seeing questions going by about ASCII -> postscript -
	   comp.sources.unix and comp.sources.misc have quite a few.
	   tpscript comes with a couple which are quite good.

You mention that you have a NEC.  Is it a 890?  If so, run it in
postscript mode and use psroff.
-- 
Chris Lewis, R.H. Lathwell & Associates: Elegant Communications Inc.
UUCP: {uunet!mnetor, utcsri!utzoo}!lsuc!eci386!clewis
Phone: (416)-595-5425

rick@pcrat.uucp (Rick Richardson) (08/23/89)

In article <1989Aug22.175443.4382@eci386.uucp> clewis@eci386.UUCP (Chris Lewis) writes:
>	   [ Kind references to the JetRoff ditroff to HPLJ Postprocessor ]
>
>	   There is a shareware version available via anon uucp.
>	   I won't post Rick's blurb because it's kinda large, it's
>	   probably out of date, and I'll get flamed for commercial
>	   advertising.  It might be a good time for him to post it, 
>	   or at least readvertise its existance and how to get it.

I'll go out on a limb and mention the particulars to get the
shareware version 1.1 (which doesn't cost anything to try) or
to contact us to get the latest licensed, supported version 2.6.
More details can be had by sending me mail, or by snagging "file_list"
as described below.

Also, there is one other fairly low cost way to get ditroff *and* HPLJ
support on SCO Xenix.  Look for the smallest ad in the back of
UNIX Today!  There's a company called Urban Applied Sciences,
201-242-7230, 24 Commerce Street, Newark, NJ  07102, that sells
DWB 2.0 for Xenix for $175 with HPLJ support.

ANON UUCP
---------
We maintain a limited anonymous uucp capability.  You can retrieve
the source code and basic fonts directly from us.  You will need
a 2400 baud modem, or a Telebit Trailblazer.  1200 baud is not supported.

For 2400 baud, here is a sample "Systems" entry for uucp:

jetroff Wk2200-0300,Sa,Su ACU 2400 12013898963 "" \d\r\d ogin: jetuucp

For Telebit, use:

jetroff Wk2200-0300,Sa,Su ACU 19200 12013898963 "" \d\r\d ogin: jetuucp

To get a list of the available files use this command:

uucp jetroff!~jetuucp/file_list wherever_you_want
OR:
uucp jetroff!/usr/jetroff/1.1/file_list wherever_you_want

NOTE: This telephone number is to be used only between 10PM and 3AM
Eastern time during the week.  If it is abused, we will remove the
anonymous uucp access. Only 2400 baud and Telebit are supported.

	PC Research, Inc.
	94 Apple Orchard Drive
	Tinton Falls, NJ 07724
	(201) 389-8963
	uunet!pcrat!jetroff
	uunet!pcrat!rick

-- 
Rick Richardson | JetRoff "di"-troff to LaserJet Postprocessor| Ask about
PC Research,Inc.| Mail: uunet!pcrat!jetroff; For anon uucp do:| Uni/JetFax
uunet!pcrat!rick| uucp jetroff!~jetuucp/file_list ~nuucp/.    | for UNIX/386
jetroff Wk2200-0300,Sa,Su ACU {2400,PEP} 12013898963 "" \d\r\d ogin: jetuucp