[comp.text] Question about Troff Fonts

rda@epistemi.UUCP (04/03/87)

Can anyone tell me how I would go about getting access to a proper
fixed-width font within troff?  

We're using ptroff and an Apple LaserWriter.  I want something like
typewriter face that I can use for stuff like program examples; switching
into constant space mode while using either Times or Helvetica is pretty
ugly.  I'm sure lots of people must have come across this problem.  Have I
ust not read the manual carefully enough?

Any suggestions welcomed.

R
-- 

Robert Dale	University of Edinburgh, Centre for Cognitive Science,
                2 Buccleuch Place, Edinburgh, EH8 9LW, Scotland.

UUCP:	...!ukc!cstvax!epistemi!rda
ARPA:	rda%epistemi.ed.ac.uk@ucl.cs
JANET:	rda@uk.ac.ed.epistemi

murray@sq.UUCP (04/10/87)

In article <1906@epistemi.UUCP> rda@epistemi.UUCP (Robert Dale) writes:
>Can anyone tell me how I would go about getting access to a proper
>fixed-width font within troff?  
>
>We're using ptroff and an Apple LaserWriter.  I want something like
>typewriter face that I can use for stuff like program examples; switching
>into constant space mode while using either Times or Helvetica is pretty
>ugly.  I'm sure lots of people must have come across this problem.  Have I
>just not read the manual carefully enough?
>
In fact, it should be fairly straightforward.  Since you have an Apple,
you also have Courier fonts.  I suspect that you should be able to use
them by selecting Courier with .ft CR.  If, however, you do not have
font tables for Courier, and your DESC file contains no reference to them,
you will have to ask your supplier (or someone on the net) to provide
the tables.

I hope that answers your question satisfactorily.
__________________________________________________________________________
						Murray C. Maloney
						Manager Technical Services
						SoftQuad Inc.
						Toronto, Ontario

jaap@mcvax.UUCP (04/14/87)

In article <1987Apr9.191355.2792@sq.uucp> murray@sq.UUCP (Murray Maloney) writes:


An absolute bogus answer to the question
 > 
 > In article <1906@epistemi.UUCP> rda@epistemi.UUCP (Robert Dale) writes:
 > >Can anyone tell me how I would go about getting access to a proper
 > >fixed-width font within troff?  
 > >
 > >We're using ptroff and an Apple LaserWriter.  I want something like
                ~~~~~~

Note that Robert Dale is using ptroff and not psroff.


 > >typewriter face that I can use for stuff like program examples; switching
 > >into constant space mode while using either Times or Helvetica is pretty
 > >ugly.  I'm sure lots of people must have come across this problem.  Have I
 > >just not read the manual carefully enough?
 > >
 > In fact, it should be fairly straightforward.  Since you have an Apple,
 > you also have Courier fonts.  I suspect that you should be able to use
 > them by selecting Courier with .ft CR.  If, however, you do not have
 > font tables for Courier, and your DESC file contains no reference to them,
 > you will have to ask your supplier (or someone on the net) to provide
 > the tables.
 > 
This means that he is using good old troff and not anything more
fancier than. So there is no DESC file etc. Good old troff was hardly
capable to switch dynamically fonts. It could do it if you had a C/A/T
directly atteched to the machine (at least, the code of V7 troff
allowed it), but for anything else it was/is sheer impossible.

The correct answer is: go and read the manual for ptroff. If you don't have it,
read the source (ptroff was a shell script the last time I looked).
If I remember correctly, it takes -F Courier. Probably that is not what you
want. You probably want R B I C and S.
Well, you cannot, since there is no way to tell pscat that you changed fonts,
so you have to drop one of the standard fonts to get the
Courier instead. Look at the manual for catmap(8) how to do this.

Using psroff is an alternative, but you need ditroff or DWB around (or have
system V, ditroff is there troff, and good old troff is otroff).

 > I hope that answers your question satisfactorily.

I cannot imagen that it was, but maybe it is now.

 > __________________________________________________________________________
 > 						Murray C. Maloney
 > 						Manager Technical Services
 > 						SoftQuad Inc.
 > 						Toronto, Ontario

Of course, you can also buy sqroff :-)

	jaap.

greenber@swatsun (Peter Greenberg) (04/15/87)

In article <1987Apr9.191355.2792@sq.uucp>, murray@sq.UUCP writes:
> 
> In article <1906@epistemi.UUCP> rda@epistemi.UUCP (Robert Dale) writes:
> >Can anyone tell me how I would go about getting access to a proper
> >fixed-width font within troff?  
> >
> >We're using ptroff and an Apple LaserWriter.  I want something like
> >typewriter face that I can use for stuff like program examples; switching
> >into constant space mode while using either Times or Helvetica is pretty
> >ugly.  I'm sure lots of people must have come across this problem.  Have I
> >just not read the manual carefully enough?
> >
> In fact, it should be fairly straightforward.  Since you have an Apple,
> you also have Courier fonts.  I suspect that you should be able to use
> them by selecting Courier with .ft CR.  If, however, you do not have
> font tables for Courier, and your DESC file contains no reference to them,
> you will have to ask your supplier (or someone on the net) to provide
> the tables.

I agree, but you do not have to contact your supplier (unless you really
want to :-> ). 

When it comes to printing on a PostScript device (like LaserWriter)
with the TranScript package (of which ptroff is a part), having Adobe Font
Metrics (AFM) files for fonts is the key to happy typesetting. If you have
an AFM file for some font that your LaserWriter supports, then you can use
ptroff or enscript to set documents in that font. If you have
no such file, you can only access fonts for which you have no AFM files
directly through PostScript programs. That is kind of fun (writing in 
PostScript, that is) but not practical for real documents.

TranScript comes with AFM files for fonts in the Times, Helvetica, and Courier
families, as well as for the symbol font. The LaserWriter Plus also has
Helvetica-Narrow, Bookman, Palatino, AvantGarde and NewCenturySchlbk font
families as well as ZapfChancery and ZapfDingbats fonts. Since Adobe does not
distribute AFM's for these fonts (at least not to us), you cannot use these 
extra fonts with just vanilla TranScript, which is a shame.

IT IS A SIMPLE MATTER TO GET AFM's FOR ANY OF THESE FONTS, FOR FREE. Just snarf 
my getafm program from net.sources! It will ask your LW or other PostScript 
creature to make you an AFM for any font that it has, and send it back to you.
Just follow the instructions in the posting to get the AFM files. Now you can
use Adobe's enscript program in any of the new fonts. To use ptroff (or pscat,
the program that actually translates troff C/A/T output to PS and through
which ptroff pipes data) you must apply Adobe's own pscatmap program, which
makes troff width files from AFMs for fonts according to a special human-
readable .map file.

Adobe's docs, I think, fail to mention that in creating the .map file, you
never, ever have to touch anything in the character correspondence table (at
least I never did!) All you really have to do is change the font names and
codes in one of their supplied .map files (helvetica.map, for example) and then 
go with it according to the pscatmap man page.

As a final note: ptroff is flawed in the way that it handles requests for font
changes; this is noted on the man page. Don't use requests like .ft CR in
your files. Rather, use only four fonts, and refer to them as R, I, B, and S
(roman, italic, bold, and symbol). This is limiting, but such is life. Note
that with pscatmap, you or your sysadmin can make you "font families" cont-
aining any four fonts that you have AFM's for.


-- 
Peter Greenberg, Swarthmore College, Swarthmore, PA 19081 
AT&T:(215) 328-8384 or 8610
UUCP: ...{{seismo | inhp4}!bpa | {sun | rutgers}!liberty}!swatsun!greenber
ARPA: swatsun!greenber@bpa.BELL-ATL.COM