This is pfb2mf. It is a copyleft program. See the file COPYING for more
details. I suggest that for the translation of Type-One to readable PostScript
you use I. Lee Hetherington's Type-1-Utils. You can find these somewhere on
obelix.icce.rug.nl in pub/erikjan.

If you find any bugs, please do report.

If you have any complaints, please do report.

Now for some info about the different stages. This package contains four
programs:

- pfb2pfa
- pfa2chr
- chr2ps
- ps2mf

= pfb2pfa:
  Usage: pfb2pfa fontfile[.pfb] [fontfile[.pfa]],
  or:    pfb2pfa fontfile[.pfb] -

  pfb2pfa will decompress an IBM (!) Postscript type 1 fontfile into readable
          and downloadable hexadecimal data.
  The resulting file still contains two layers of encryption:
  - eexec encryption
  - charstring encrytion

= pfa2chr
  Usage: pfa2chr fontfile[.pfa] [fontfile[.chr]],
  or:    pfa2chr [fontfile[.pfa]|-] [fontfile[.chr]|-]
  pfa2chr will do an eexec-decryption of a readable hexadecimal font file to a
  fontfile with encrypted charstrings.

= chr2ps
  Usage: chr2ps fontfile[.chr] [fontfile[.ps]],
  or:    chr2ps [fontfile[.chr]|-] fontfile[.ps],
  chr2ps will perform a charstring-decryption of a font file with encrypted
  charstrings to fontfile with postscript commands for type 1 fonts.

With a "-" as filename, these programs will read from <stdin> and write to
<stdout>. This way you can pipe the results, as in:

pfb2pfa garmnd - | pfa2chr - - | chr2ps - garmnd

This will create a <garmnd.ps> from <garmnd.pfb> without explicitely creating
the intermediate files.

These previous stages can be replaced by (when using Lee Hetherington's
type-1-utils):

t1disasm garmnd.pfb garmnd.ps

= ps2mf
  Usage: ps2mf basename -C [-p psfile[.ps]] [-a afmfile[.afm]]
                           [-m mffile[.mf]] [-c configfile[.cfg]]
  This last stage will convert to a MetaFont program with the use of the
  corresponding <.afm> file and a mapping configuration file. It can convert
  to an ordinary form with B'ezier controlpoints. It can also generate a curl
  specification. For this last option specifify -C.

How to get this running?

If you are on a UNIX system, check the Makefile and adapt to your situation.

If you are on MSDOS, search for the executables, e.g. on obelix.icce.rug.nl in
pub/erikjan. If you want to create them yourself, obey the following rules:

If you do not have the ANSI "strstr" function, I have included the public
domain version of <strstr.c>. Therefore this notice should be here:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
If you use this function, you must compile it, then link with this objectfile.

If you do not have "alloca", I have included a public domain version of
<alloca.c> and <xmalloc.c>. If you use this function, you must compile it,
then link with this objectfile.

Now run pfb2hex, then hex2chr, chr2ps and finally ps2mf. This will result in a
<.mf> file which you can --in some way-- input to MetaFont.

Suppose we want to translate <garmnd.pfb> to <garmnd.mf>. If you are on a UNIX
box, just run "make garmnd.mf" and it will automasomethingly create this file
for you. For those of you not on UNIX, this is what that last command does:

pfb2hex garmnd.pfb garmnd.hex
hex2chr garmnd.hex garmnd.chr
chr2ps garmnd.chr garmnd.ps
ps2mf garmnd -c cm

That last command will read in <garmnd.ps>, <garmnd.afm> and <Latin.cfg> and
it will write <garmnd.mf>. That file <cm.cfg> is a configurationfile I have
created after a suggestion by Yannis Haralambous. It maps PostScript
characters to "TeX text" characters according to the following syntax:

Encoding <text> ;
C <decimal number> ; N <name> ;( L <name> <name> ;)*
D <decimal number> ; N <name> ;( L <name> <name> ;)*
H <hexadecimal number> ; N <name> ;( L <name> <name> ;)*
O <octal number> ; N <name> ;( L <name> <name> ;)*
I <name> ;

meaning: this configurefile encodes according to the named scheme. associate
Code <number> (where <number> can be either decimal, hexadecimal or octal as
specified with the C/D, H or O opcode) with Name <name>; optionally this
character has some ligatures. or ignore <name>. all other lines are treated as
comment.

These are some lines from <cm.cfg>:

-----------
Encoding TeX text ;	The following encoding follows the TeX text scheme
I nbspace ;		Ignore this character
I space ;		Ignore this character
I .notdef ;		Ignore this character
C 12  ; N fi ;		Map character "fi" to code 12
C 13  ; N fl ;		Map character "fl" to code 13
C 16  ; N dotlessi ;
C 18  ; N grave ;
C 30  ; N OE ;
C 31  ; N Oslash ;
Comment 32  ; N space ;	This is comment since there is no command on the line
C 33  ; N exclam ; L quoteleft exclamdown ;
			Map character "exclam" to code 33; if this character
			is followed by a backquote change them to an
			upside-down-exclamationmark
C 34  ; N quotedblright ;
C 38  ; N ampersand ;
C 39  ; N quoteright ; L quoteright quotedblright ;
C 40  ; N parenleft ;
-----------

Note: the programs will not (yet) work for Mac type 1 postscript font files!

If you have created a MetaFont commandfile, you must create a MetaFont
parameterfile which calls your commandfile with an appropriate setting of the
variable <FontSize>. This variable needs a sharped value. An example:

-------
% Garamond-Normal. 10pt.

FontSize := 10pt#;

input garmnd
-------

Now you can run MetaFont. Of course, you do not run it with <cm.base> loaded.
We're not creating Computer Modern, right?

Lee Hetherington has created a <hints.mf> file which implements
hint-translation.

Johan Vromans sent patches which have solved the pathmystery.

Jan Michael Rynning has found a bug in the "seac" implementation.

Some more info:

The programs were originally develloped using Turbo C++ (Borland), ANSI-C
option. But they have succesfully compiled on two UNIX boxes (IBM RT PC with
CC, and SUN 386 under SUNOS 4.0.2 with GCC) and under DOS (with the MicroSoft
C compiler, version 6.00A).

Authors: Marcel Dings (original idea) and Erik-Jan Vens (new ps2mf).

Addresses:

- Marcel Dings
    AKZO Research Laboratories Arnhem | 
    Dep. CRT                          |
    M.M.M. Dings                      |  DINGS@rug.nl
    P.O.Box 9300                      |
    6800 SB  Arnhem                   |
    the Netherlands                   |

- Erik-Jan Vens
    University of Groningen/ICCE      |
    P.O.Box 335                       |  E.J.Vens@icce.rug.nl
    9700 AH  Groningen                |
    the Netherlands                   |

And we thank you!
