From: henry@trilithon.mpk.ca.us (Henry McGilton)
Subject: Re: font convertors from adobe to postscript
Organization: Trilithon Software
Date: Mon, 14 Dec 1992 01:44:06 GMT

In article <zisk-301192140510@macne037.boston.us.adobe.com> zisk@adobe.com  
(Stephen Zisk) writes:

    *  In article <carol.722733984@menaik>, carol@cs.UAlberta.CA
    *  (Carol Smith) wrote concerning conversion of Mac "adobe"
    *  fonts to Unix "PostScript" fonts.

    *  All the formats you mentioned are variations on a single
    *  theme: Type 1 fonts. These are neither "PostScript" nor
    *  "Adobe" fonts except by association. They are usable by
    *  PostScript printers, ATM, Display PostScript, and any other
    *  program which cares to implement a rasterizer based on the
    *  specification in the "Adobe Type 1 Format" book.
Well said -- keep plugging.  Help stamp out mis/dis-information.

    *  Type 1 fonts for the Macintosh and PC are "compressed"
    *  using a simple scheme which relies on the fact that the
    *  bulk of a Type 1 font is data which has been encrypted and
    *  encoded. It is decrypted/decoded by PostScript using the
    *  eexec operator, which reads so-called "hex" data.  This is
    *  binary data which has been expanded by representing the
    *  data as hexadecimal in ASCII. This results in a 2:1 expansion.
    *  On the Mac and PC, this data is stored as its binary
    *  equivalent, and expanded by a driver or font downloader
    *  for transmission to the printer.
This is a good exposition of what happens on Macintosh (and PC).

The hard part comes when you have to deal with UNIX systems, which
have nothing resembling either a printer manager or a font downloader.
And with few exceptions (parts of the Adobe Type Library are
available for the NeXT), Type 1 fonts are not available for UNIX
systems in a form UNIX systems can use, so you have to buy your
fonts in Macintosh or PC format and somehow convert them for UNIX
systems.

    *  There is at least one public domain (or freeware, I am not
    *  sure!) program for the Mac which expands the font to its
    *  "native" Type 1 format: unAdobe, created by Mitre and
    *  available on sumex-aim and other standard ftp sites.
Expanding the font on the Macintosh side still doesn't do you a
lot of good.  Expanding the binary sections to hexadecimal is the
easy bit.  Then you have to get the Macintosh file over to the UNIX
system in question, and that's where all the fun starts.  There
are various ways to get font files over to a Sun, for instance.
But then you need a program on the Sun end to interpret the data.

First off, Macintosh font files can come at you in several different
formats, such as MacBinary or as resource and data forks.  Then the
format of the resource fork varies depending on the tool you used to
do the transfer.

For instance, if you bring the file across from the Macintosh to
the Sun using TOPS, you get some strange resource fork format that
I've never been able to figure out -- it's nothing like the normal
resource fork of a Macintosh file.  I had a dialog a couple of
years back with one of the engineers at Sitka who had actually
taken part in writing the Macintosh to Sun file transfer, and *he*
didn't seem to have a clue what I was talking about.

Then you get more fun.  A ``normal'' Type 1 font has all the font
data in the resource fork of the Macintosh file.  The data fork is
empty.  The layout of a resource fork is not trivial.  You
can also get situations where the resource fork contains a marker
telling you that the font data is actually in the data fork.

The PC format is a whole lot easier to deal with.

    *  I am less familiar with products on the PC, but in any
    *  case, the format on a PC is very simple. It consists of a
    *  header which contains pointers to ascii sections, hex
    *  sections, and end-of-file. If you want the details, I am
    *  a bit fuzzy, but perhaps someone else in the group can reply?
The description is very slightly off.  Each section (ASCII, binary,
or EOF) is preceded by a header specifying the type of section and
the length of that section.  The format of PC font files (known as
PFB for Printer Font Binary) is documented in Adobe Tech Note #5040
-- Supporting Downloadable Fonts.

The format of Macintosh font files is also kind of sort of halfway
documented in Adobe Tech Note #5040, but it leaves out a whole lot
-- you basically have to know about the layout of the resource fork
of a Macintosh file to be able to use the description correctly.


	........  Henry
Newsgroups: comp.lang.postscript