[comp.unix.questions] Courier font in troff

pac@munsell.UUCP (09/02/87)

How can I use the Courier (typewriter like, fixed width) font in
troff?  I am using a Sun running SunOS 3.2 with a Sun purchased
Laserwriter and troff.  Everything is off the shelf and standard.

Thank you.

					pZ
-- 
			       Paul Czarnecki -- My newsfeed's in Esperanto
	{{harvard,ll-xn}!adelie,{decvax,allegra,talcott}!encore}!munsell!pz

allyn@sdcsvax.UCSD.EDU (Allyn Fratkin) (09/04/87)

In article <1196@pinney.munsell.UUCP>, pac@munsell.UUCP () writes:
> How can I use the Courier (typewriter like, fixed width) font in
> troff?  I am using a Sun running SunOS 3.2 with a Sun purchased
> Laserwriter and troff.  Everything is off the shelf and standard.

We are using Adobe's Transcript package for our Sun running SunOS 3.2
with an Apple Laserwriter.  We use troff (not ditroff).  I do not know 
how close Sun's package is to Transcript.  I will describe what I did to 
use Courier in the hopes that it can guide you (and others).

In the directory /usr/lib/ps/troff.font there is a file called Helvetica.map
that lists the Helvetica font to troff character mapping.  Copy this to
Courier.map and change all the Helvetica references to Courier.
(There is a context diff for the two files appended to this message.)

Then type "make FAMILIES=Courier" and you should be done.  This will
create the files Courier.ct, Courier.head, ftC, ftCI, and ftCB.

Good Luck!

---- cut here -----
*** Helvetica.map	Tue Jun  9 14:13:17 1987
--- Courier.map	Thu Sep  3 13:27:32 1987
***************
*** 2,8 ****
  %
  % Copyright (c) 1985 Adobe Systems, Inc.
  %
! % Font correspondence mapping for Troff and PostScript Helvetica family.
  %
  % PostScript and TranScript are trademarks of Adobe Systems, Inc.
  % Times is a trademark of Allied Corporation.
--- 2,8 ----
  %
  % Copyright (c) 1985 Adobe Systems, Inc.
  %
! % Font correspondence mapping for Troff and PostScript Courier family.
  %
  % PostScript and TranScript are trademarks of Adobe Systems, Inc.
  % Times is a trademark of Allied Corporation.
***************
*** 33,47 ****
  % generated that, when compiled, are used by troff as width
  % tables.
  
! % note that we will ignore HS and mount "S" when using troff!
  
! @FAMILYNAME Helvetica
! @FACENAMES H HI HB HS
  
  @BEGINFONTS
! ROMAN=Helvetica
! ITALIC=Helvetica-Oblique
! BOLD=Helvetica-Bold
  SYMBOL=Symbol
  EXTRAS=Times-Roman
  @ENDFONTS
--- 33,47 ----
  % generated that, when compiled, are used by troff as width
  % tables.
  
! % note that we will ignore CS and mount "S" when using troff!
  
! @FAMILYNAME Courier
! @FACENAMES C CI CB CS
  
  @BEGINFONTS
! ROMAN=Courier
! ITALIC=Courier-Oblique
! BOLD=Courier-Bold
  SYMBOL=Symbol
  EXTRAS=Times-Roman
  @ENDFONTS

-- 
 From the virtual mind of Allyn Fratkin            allyn@sdcsvax.ucsd.edu    or
                          EMU Project              {ucbvax, decvax, ihnp4}
                          U.C. San Diego                         !sdcsvax!allyn

gwyn@brl-smoke.ARPA (Doug Gwyn ) (09/04/87)

In article <1196@pinney.munsell.UUCP> pac@munsell.UUCP () writes:
>How can I use the Courier (typewriter like, fixed width) font in
>troff?  I am using a Sun running SunOS 3.2 with a Sun purchased
>Laserwriter and troff.  Everything is off the shelf and standard.

Just request the font by its correct name (which depends on the
names supplied with your software).  The most common name for
that font is "CW", so assuming that applies to you:

.ft CW
This is set in constant-width (typewriter) font.
.ft	\" restore previous font

or

stuff \f(CWconstant-width\f0 more stuff

Some macro packages also have a .CW (and .CN) macro to enter
(leave) constant-width font mode.

Your typewriter font may only be available in certain point
sizes (usually 10 and 12).

schwartz@gondor.psu.edu (Scott E. Schwartz) (09/04/87)

It turns out that the courier font on the apple laser writer
(which is what sun sells you under their brand name) does not
have ligatures.  So things like "fi" will come out wrong
unless you make sure to tell troff not to use ligatures in 
courier.  I think the relevent configuration files are in 
/usr/lib/fonts.

-- Scott

allyn@sdcsvax.UCSD.EDU (Allyn Fratkin) (09/05/87)

In article <2903@psuvax1.psu.edu>, schwartz@gondor.psu.edu (Scott E. Schwartz) writes:
> It turns out that the courier font on the apple laser writer
> (which is what sun sells you under their brand name) does not
> have ligatures.  

you're right.  here's what to do (if you followed my advice in a previous
message).  just append the single line:

.lg 0

to your /usr/lib/ps/troff.font/Courier.head file.  this will turn
off all ligatures for the Courier font automatically.

-- 
 From the virtual mind of Allyn Fratkin            allyn@sdcsvax.ucsd.edu    or
                          EMU Project              {ucbvax, decvax, ihnp4}
                          U.C. San Diego                         !sdcsvax!allyn

ron@topaz.rutgers.edu (Ron Natalie) (09/06/87)

If you are using a Apple LaserWriter on a UNIX machine you are
probably using either the PSDIT driver (for ditroff), in which
case Doug's comments are correct, or using PSCAT with the old
troff.

To use PSCAT and Courier, you have to specify an alternate font
family of courier.  This is done with the -F options.  Best to
use the provided ptroff shell scripts to get all this right.
Note that you can't mix font families with the old troff.  A
further complication is that for some reason the Courier device
tables weren't generated in my distribution.  However, this is
easy to fix, and if you need to know, I will try to remember what
I did.

-Ron