From: walsh@cs.umass.edu (Norman Walsh)
Newsgroups: comp.fonts,news.answers
Subject: comp.fonts FAQ: part 4 of 5
Summary: This posting answers frequently asked questions about fonts.
         It addresses both general font questions and questions that
	 are specific to a particular platform.
Date: 2 Oct 92 18:06:22 GMT
Expires: 6 Nov 92 00:00:00 GMT
Reply-To: walsh@cs.umass.edu (Norm Walsh)
Followup-To: poster
Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)

Archive-Name: fonts-faq/part4
Version: 1.0.0

--- [cut here] --- FAQ for comp.fonts: section 2, part 2 of 2 ---


FAQ for comp.fonts: Part VIII: Font utilities

Version 1.0.0, Release 02OCT92


This section is divided into the following topics:

0.  Notes about the utilities
1.  PS2PK
2.  TeX Utilities
3.  MFPic
4.  GNU Font Utilities
5.  Font Editors
6.  t1utils

------------------------------------------------------------------------------

0. Notes about the utilities

   I have just started collecting information about font utilities.  I 
   will gladly add any information that you can pass my way.  Please send
   your submissions to norm <walsh@cs.umass.edu>.  

   I would appreciate it if you could include a paragraph or so of description
   and the appropriate site/filename for retrieval.

1. PS2PK version 1.2

  PS2PK is a utility for converting Type1 postscript fonts into TeX PK files.
  The source code is distributed and it has been compiled for both *nix boxes
  and MS-DOS based machines.

  Here is the original announcement:

                            Ps2pk-1.2 available
                            -------------------
                                 (June 1992)
    
    Version 1.2 of ps2pk is now available on:
       ftp.urc.tue.nl (address: 131.155.2.79)
       directory:    /pub/tex
       files:        ps2pk12.README         (  1k)    This file
                     ps2pk12.tar.Z          (391k)    Sources
                     ps2pk386.zip           (232k)    MSDOS executables
                     utopia.tar.Z           (342k)    Adobe Utopia font family
                     courier.tar.Z          (207k)    IBM Courier font family
    
       For people having difficulties in handling UNIX `.tar.Z' format I
       have made some UNIX tools (only executables) available in:
       directories:  /pub/unixtools/dos
                     /pub/unixtools/vms
    
       See the system specific TARZ file for some help.
    
       Ftp.urc.tue.nl can not handle E-mail requests. But sites are free
       to put the ps2pk12 stuff on any server that can.
    
    When do you need ps2pk?
    ----------------------
    Ps2pk is a tool that converts a PostScript type1 font into a corres-
    ponding TeX PK font.  The tool is especially interesting if you want
    to use fully hinted type1 fonts in your DVI previewer (instead of the
    unhinted type1 fonts currently used in GhostScript) or on a printer
    that has no PostScript interpreter.
    
    In order to use the ps2pk generated fonts your driver and previewer need
    to support virtual fonts.  The reason is that PostScript fonts and TeX
    fonts do have a different font encoding and handle ligatures in a
    different way.  With virtual fonts the PostScript world (encoding +
    ligatures) can be mapped to the old style TeX world on which the current
    plain macro packages still are based (despite the fact that TeX3.0 can
    handle 8bits).
    
    It is also possible to use the ps2pk generated PK fonts directly
    
  In addition, a modified version of PS2PK exists on ibis.cs.umass.edu.  I
  have added some hacks to better support really large renderings and a
  primitive "range" facility.

2. TeX Utilities

  There are many TeX font utilities.  For TeX related questions, I direct
  you to comp.text.tex or the Info-TeX mailing list.  I will happily list
  any utilities here that the comp.fonts public feels should be present.
  I am listing MetaFont because it is the obvious font-specific component
  of TeX and PKtoSFP because it allows anyone to use PS2PK to create
  LaserJet softfonts.

  Liam R. E. Quin <lee@sq.com> is the original author of the MetaFont
  section.  It has been hacked at a bit by norm to make it fit the tone
  of the comp.fonts FAQ.  Assume that norm is responsible for any errors,
  not Liam.

2.1. MetaFont

2.1.1. About MetaFont:

       Metafont is a programming language for describing fonts.  It was
       written by Donald Knuth and is documented in

	 Computers & Typesetting/C: The METAFONTbook
	 Knuth, Donald E.
	 Addison Wesley, 1986
	 ISBN 0-201-13445-4, or 0-201-13444-6 (soft cover)
	 Library access: Z250.8.M46K58, or 686.2'24, or 85-28675.

       A font written in MetaFont is actually a computer program which,
       when run, will generate a bitmap (`raster') for a given typeface
       at a given size, for some particular device.

2.1.2. What do you need in order to use the fonts:

       You cannot print the MetaFont fonts directly (unless you want a
       listing of the program, that is).  Instead, you must generate a
       bitmap font and use that to print something.

       If you are using TeX, the sequence of steps is something like
       this:

         MF -> metafont -> GF  	        [ convert MetaFont program
                           TFM	          into a bitmapped font ]
  
         GF -> gftopk -> PK             [ represent the bitmapped font
                                          efficiently ]

         TEX -> tex -> DVI              [ convert TeX document into
         TFM                              device independent output ]

         DVI -> dvi2xxx -> XXX          [ convert DVI to output device
         PK                               format ]

         XXX -> printer -> hardcopy     [ print the dvi2xxx output ]

       The above steps are idealized.  In reality, you have to make sure
       that the fonts get installed in the correct places and you may
       have to adjust description files, etc.  The friendly folks on
       comp.text.tex can probably get it staightened out for you if you
       can't find a local guru.

       If you are not using TeX, it's almost impossible to predict.  At
       some point in the above sequence, you'll insert some other
       conversion program and proceed differently.  Here, for example, is
       how you might use TeX fonts with WordPerfect and a LaserJet
       printer.

         PK -> PKtoSFP -> SFP           [ PK to LaserJet softfont ]

	 SFP -> SFP2Auto -> TFM         [ Make HP AutoFont TFM file ]

 	 SFP -> PTR -> installation     [ Install the fonts into WP ]
	 TFM

	 Use WordPerfect as you normally would.

2.1.3. How to use Metafont fonts with Troff
 
       If, when you run troff, you get the message `typesetter busy', you
       have the original Ossanna-troff, also called otroff.  Chris Lewis
       has a package which will let you use TeX fonts with troff -- it's
       called psroff, and comes with documentation.

         ftp: gatekeeper.dec.com (16.1.0.2) pub/misc/psroff-3.0
         ftp: ftp.cs.toronto.edu [128.100.1.105] pub/psroff-3.0/*

       If, when you run troff, you get something like this:

	 x T 300
	 x res 300 1 1

       you have ditroff.  This is sometimes called titroff or psroff.  In
       this case, you will probably need to do the following:

         1) convert the font to your printer's format
         2) generate a width table for the font
         3) add the font to the DESC file for the appropriate device
         4) arrange for troff to download the font
         5) tell troff about the font by running `makedev DESC' in the 
	    right place.

       If, when you run troff, you get something like this:
 
         X hp(SCM)(CM)(AF)(AD) 300 1 1
	 Y P default letter 2550 3300 0 0 90 90 2460 3210

       you have sqtroff:

         1) convert the font to your printer's format
         2) generate a width table for the font
         3) add the font to the DESC file for the appropriate device
         4) put the font in the appropriate raster directory
         5) tell sqtroff about the font by running `sqmakedev DESC' or 
            `sqinstall'.

       In each case, you should be able to get help from your vendor.

       Note that Chris Lewis' psroff package has software to make width
       tables for troff from pk files.

2.1.4. Converting between font formats

       Conversions to and from pbm and pk format were posted to
       comp.text.tex and to alt.sources on the 9th of August, 1990 by
       Angus Duggan (ajcd@cs.ed.ac.uk).  The program is pbmtopk, and
       there are also at least two patches.

       Chris Lewis' psroff package includes a program to go from pk both
       to the HP LaserJet and to PostScript.

       John McClain (ophelp@tamvenus.bitnet) has some conversion programs
       for various graphics formats to/and from pk files.

       A PC program, CAPTURE, turns HPGL files into PK format, US$130
       from Micro Programs Inc., 251 Jackson Ave., Syosset, NY 11791
       U.S.A.

       Metaplot can take pen-plotter files and prouce metafont files;
       contact wilcox@cis.ohio-state.edu

       Kinch Cmputer Company sell .pk fonts derived from PostScript
       fonts.  Kinch Computer Co., 501 S. Meadow St.Ithaca, NY 14850
       U.S.A.  telephone: +1 607 273 0222; fax: +1 607 273 0484

2.1.5. Where to get bitmap versions of the fonts

       There are archives containing the bitmaps of many of these fonts
       at various sizes and resolutions.  The fonts must have been
       generated for the correct print engine: e.g. write-white or
       write-black.  The archives generally hold only the sizes used by
       TeX.  These are `magstep' sizes, and are not exact point sizes.
       It is probably better to generate them from the Metafont sources
       yourself if you can.

       The best place to look for raster fonts was almost certainly

         mims-iris.waterloo.edu

       but it isn't any more, the fonts have all gone.  Let me know if
       you find them elsewhere.  Most people seem to have moved to using
       PostScript fonts or Bitstream ones instead now.

       Some other sites are:

         ctrsci.math.utah.edu (128.110.198.1)
         science.utah.edu (128.110.192.2)
         ymir.claremont.edu (134.173.4.23)

       The occasional posting of ftp sites to comp.misc and comp.archives
       lists these and several other sites.

2.1.6. Getting fonts by FTP and Mail

       If you are using ftp, you will need either the name of the host or
       the Internet number.  For example, to connect to ymir, listed as
       ftp: ymir.claremont.edu [134.173.4.23] you will need to type
       something like

         ftp ymir.claremont.edu

       If that doesn't work, try using the number:

	 ftp 134.173.4.23
 
       If that doesn't work, on Unix systems you can use nslookup (it's
       usually /usr/etc/nslookup) to find the host number -- it might
       have changed.  Type the entire host name, and after a few seconds
       nslookup will give you the address.

       Once you have connected, you will need to go to the appropriate
       directory, lists its contents, and retrieve the files.
 
       Most of the machines listed here run Unix, and you use "ls" and
       "cd" to list files and to change directories.  Ymir runs VMS, and
       you will have to put square brackets around directory names, like
       [this].

       Remember that although Metafont sources are text files, pk fonts
       are not ASCII, and you will have to use binary mode for them.  In
       general, use text mode for README files and *.mf files, and binary
       mode for other font files.  Files ending in .Z are compressed
       binary files -- you will need to use binary mode, and then
       uncompress the files when you get them.


       You can get files from ymir by sending mail messages to

         mailserv@ymir.claremont.edu

       For example,

         send [tex.mf.misc]cmapl10.mf

       will get the file cmapl10.mf from the directory "tex.mf.misc".
       You can't get binary files in this way.

       There is an ftp-by-mail BITNET service, BITFTP, for BITNET users.

       Before getting large files by mail, please remember to get
       permission from all intervening sites.  Ask your site
       administrator, who can send mail to Postmaster at each site on the
       way if necessary.

2.2. PKtoSFP/SFPtoPK

       Convert fonts from TeX PK format to HP LaserJet (bitmap) format.

2.3. Metafont -> PostScript conversion

       There are (I believe) two programs that perform this task.  At
       least one of them is called "mf2ps".  If you have any more 
       information about these tools, please let me know.

2.4. PostScript -> Metafont

       There is at least one tool for this purpose.  I believe that it
       is called "ps2mf".  If you have any more information about
       these tools, please let me know.

2.5. PKtoPS

       Included in the psroff distribution, this utility converts PK 
       fonts into PostScript fonts (bitmaps, I presume).  If you have
       any more information about these tools, please let me know.

2.6. PKtoBDF / MFtoBDF

       From the SeeTeX distribution, programs to help previewers under
       X11.

3. MFpic

  MFpic is a macro package for including pictures in TeX documents.  The idea
  behind this package is to have Metafont do the actual drawing, and store the
  pictures in a font that TeX can include in the document.  The macros have
  been designed so that the user should never have to learn Metafont to use
  these macros -- the TeX macros actually write the Metafont file for you.

4. GNU Font Utilities

  Here is a brief description of the programs included:

  * imageto extracts a bitmap font from an image in PBM or IMG format, or
    converts the image to Encapsulated PostScript.

  * xbfe is a hand-editor for bitmap fonts which runs under X11.

  * charspace adds side bearings to a bitmap font.

  * limn fits outlines to bitmap characters.

  * bzrto converts a generic outline font to Metafont or PostScript.

  * gsrenderfont renders a PostScript outline font at a particular point
    size and resolution, yielding a bitmap font.

  * fontconvert can rearrange or delete characters in a bitmap font,
    filter them, split them into pieces, combine them, etc., etc.

  * imgrotate rotates or flips an IMG file.

  We need volunteers to help create fonts for the GNU project.  You do not
  need to be an expert type designer to help, but you do need to know enough
  about TeX and/or PostScript to be able to install and test new fonts.
  Example: if you know neither (1) the purpose of TeX utility program `gftopk'
  nor (2) what the PostScript `scalefont' command does, you probably need more
  experience before you can help.

  If you can volunteer, the first step is to compile the font utilities.
  After that, contact me (karl@gnu.ai.mit.edu).  I will get you a scanned type
  specimen image.  The manual explains how to use these utilities to turn that
  into a font you can use in TeX or PostScript.

  You can get the source by ftp from 
    prep.ai.mit.edu [18.71.0.38]:pub/gnu/fontutils-0.5.tar.Z.

  And also from these other sites around the world; please check them
  before prep.

  United States: wuarchive.wustl.edu   gatekeeper.dec.com:pub/GNU
                 uxc.cso.uiuc.edu      ftp.uu.net:packages/gnu

  Europe:        archive.eu.net        src.doc.ic.ac.uk:gnu    ftp.funet.fi
                 nic.funet.fi:pub/gnu  ugle.unit.no            isy.liu.se
                 ftp.diku.dk

  elsewhere:     ftp.cs.titech.ac.jp   utsun.s.u-tokyo.ac.jp:ftpsync/prep
                 archie.au:gnu

  You can also order tapes with GNU software from the Free Software Foundation
  (thereby supporting the GNU project); send mail to gnu@prep.ai.mit.edu for
  the latest prices and ordering information, or retrieve the file DISTRIB
  from a GNU archive.

5. Font editors

  - BDF -

    There is a bdf font editor that comes with HP/Apollo workstations.  It's
    called 'edfont'.  It's not the best but it works.

  - PK -

    The GNU font utilities include an X-based editor called Xbfe which edits
    bitmapped fonts under X.

    Eberhard Mattes' emTeX includes PKedit.

6. t1utils

  This is a snippet from the README file for I. Lee Hetherington's 
  <ilh@lcs.mit.edu> t1utils package:

  t1utils is a collection of simple type-1 font manipulation programs.
  Together, they allow you to convert between PFA (ASCII) and PFB
  (binary) formats, disassemble PFA or PFB files into human-readable
  form, reassemble them into PFA or PFB format.  Additionally you can
  extract font resources from a Macintosh font file (ATM/Laserwriter).

-- END OF PART VIII --
--- [cut here] --- FAQ for comp.fonts: section 2, part 2 of 2 ---