nroff drivers

Chris Lewis clewis at eci386.uucp
Wed Aug 23 04:14:24 AEST 1989


In article <688 at vector.Dallas.TX.US> chip at vector.Dallas.TX.US (Chip Rosenthal) writes:
>In article <9284 at chinet.chi.il.us> randy at chinet.chi.il.us (Randy Suess) writes:
>>	Even better for Laserjet or DeskJet people is jetroff.

>for SCO's troff.  Jetroff only works with ditroff input, and therefore
>you need to convert the otroff to ditroff.  There is a program in the
>comp.sources.unix archives which does this (cat2dit), but my experience
>is that you get really goofy looking output, mainly due to problems with
>spacing.  Admittedly I haven't played around with it a lot, so it is
>possible that some tweaking could fix it.

Most definately.  The difficulty is that CAT troff has its set of character
width tables (/usr/lib/font/ft*) which are the CAT's widths, not the laserjet's.
Jetroff presumably comes with a set of width files for ditroff, which, of
course, CAT troff can't make hide-nor-hair of.  Cat2dit is presumably
ONLY the CAT->ditroff transliterator, for cat2dit don't really know
what type printer you are *really* driving and wouldn't come with width
tables.

It is possible to tweak the ft?? files by hand.  In Xenix, the ft?? files
are merely a 224 character array, where each entry is the width of
the character in 1/432's of an inch when printed at 6 point.  Further,
each entry is or'd with 0200 if it has an ascender  and/or 0100 if it
has a descender.  The usual trick is to define the array in C (say ftA.c), 
and then "fwrite" it (ultimately to /usr/lib/font/ftA).  I used to print 
test documents and guesstimate increments/decrements to the table until 
it looked good.  My psroff package has a postscript utility borrowed from 
tpscript to generate ditroff font tables, and a utility that I wrote to convert
them to ft* files.  In the case of a Laserjet, the best method would
be to take jettroff's width tables (I assume that jetroff has 'em - in 
ditroff) and run 'em thru my ditroff to CAT width table converter.

The following is a (probably not extensively) hand-tweaked width table 
for AvantGarde-Book on a AppleLaser, showing character correspondence:

> char ftA[256-32] = {	/*AvantGarde-Book*/
> 12,	 /*space*/
> 11,	 /*!*/
> 0,	 /*"*/
> 0,	 /*#*/
> 20,	 /*$*/
> 28,	 /*%*/
> 27,	 /*&*/
> 13,	 /*' close*/
> 13,	 /*(*/
> 13,	 /*)*/
> 15,	 /***/
> 22,	 /*+*/
> 10,	 /*,*/
> 12,	 /*- hyphen*/
> 10,	 /*.*/
> 16,	 /*/*/
> 20+0200, /*0*/
> 20+0200, /*1*/
> 20+0200, /*2*/
> 20+0200, /*3*/
> 20+0200, /*4*/
> 20+0200, /*5*/
> 20+0200, /*6*/
> 20+0200, /*7*/
> 20+0200, /*8*/
> 20+0200, /*9*/
> 10,	 /*:*/
> 10,	 /*;*/
> 0,	 /*<*/
> 22,	 /*=*/
> 0,	 /*>*/
> 21,	 /*?*/
> 0,	 /*@*/
> 27+0200, /*A*/
> 21+0200, /*B*/
> 29+0200, /*C*/
> 27+0200, /*D*/
> 19+0200, /*E*/
> 17+0200, /*F*/
> 31+0200, /*G*/
> 25+0200, /*H*/
> 8+0200, /*I*/
> 17+0200, /*J*/
> 21+0200, /*K*/
> 17+0200, /*L*/
> 33+0200, /*M*/
> 27+0200, /*N*/
> 31+0200, /*O*/
> 21+0200, /*P*/
> 31+0300, /*Q*/
> 22+0200, /*R*/
> 18+0200, /*S*/
> 15+0200, /*T*/
> 24+0200, /*U*/
> 25+0200, /*V*/
> 35+0200, /*W*/
> 22+0200, /*X*/
> 21+0200, /*Y*/
> 17+0200, /*Z*/
> 13,	 /*[*/
> 0,	 /*\*/
> 13,	 /*]*/
> 0,	 /*^*/
> 0,	 /*_*/
> 13,	 /*` open*/
> 25,	 /*a*/
> 25+0200, /*b*/
> 23,	 /*c*/
> 25+0200, /*d*/
> 23,	 /*e*/
> 11+0200, /*f*/
> 24+0100, /*g*/
> 22+0200, /*h*/
> 7+0200, /*i*/
> 7+0300, /*j*/
> 18+0200, /*k*/
> 7+0200, /*l*/
> 34,	 /*m*/
> 22,	 /*n*/
> 24,	 /*o*/
> 25+0100, /*p*/
> 25+0100, /*q*/
> 11,	 /*r*/
> 14,	 /*s*/
> 12+0200, /*t*/
> 22,	 /*u*/
> 20,	 /*v*/
> 30,	 /*w*/
> 17,	 /*x*/
> 19+0100, /*y*/
> 15,	 /*z*/
> 0,	 /*{*/
> 2,	 /*|*/
> 0,	 /*}*/
> 0,	 /*~*/
> 6,	 /*narrow space*/
> 13,	 /*hyphen*/
> 27,	 /*bullet*/
> 27,	 /*square*/
> 36,	 /*3/4 em*/
> 18,	 /*rule*/
> 29,	 /*1/4*/
> 29,	 /*1/2*/
> 29,	 /*3/4*/
> 36,	 /*minus*/
> 18,	 /*fi*/
> 17,	 /*fl*/
> 23,	 /*ff*/
> 30,	 /*ffi*/
> 30,	 /*ffl*/
> 15,	 /*degree*/
> 20,	 /*dagger*/
> 0,	 /*section*/
> 8,	 /*foot mark*/
> 0,	 /*'*/
> 0,	 /*`*/
> 0,	 /*_*/
> 0,
> 3,	/*half nar sp*/
> 0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,0,0,0,
> 0,0,0,0,0,
> 20,	 /*registered*/
> 20,	 /*copyright*/
> 0,
> 19,	 /*cent*/
> };
-- 
Chris Lewis, R.H. Lathwell & Associates: Elegant Communications Inc.
UUCP: {uunet!mnetor, utcsri!utzoo}!lsuc!eci386!clewis
Phone: (416)-595-5425



More information about the Comp.unix.xenix mailing list