[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Problems with AFM::Font



Several issues collide here.

First, Macs don't usually have AFM (.afm) files installed. There
are applications that use them, however, and Adobe provides Mac
AFM files for its fonts at

	<ftp://ftp.adobe.com/pub/adobe/type/mac/all/afmfiles/>

These files are arranged in numbered subdirectories which I think
correspond to the Adobe type package numbers.  The actual file
names correspond to the Type 1 font files.  These use the 5/3/3
rule to get names like BookmLigIta.afm for Bookman-Light Italic
(hypothetical example).


Second, AFM files are platform-independent.  The specification
for AFM files is at:

	<http://www.adobe.com/supportservice/devrelations/PDFS/
	TN/5004.AFM_Spec.pdf>

There are applications -- such as the one I'm working on :) --
that use the AFM file for a font without actually using the font
itself.  I can use AFM files for fonts that are not installed on
my Mac.


Third, the Font::AFM module aims to parse AFM files and provide an
object interface to the metrics. This capability can be supported
on any platform.

Font::AFM does not promise to find the AFM files.

Font::AFM gives the user control over where the AFM files are:

 - The user can specify a path along with the file name.
 - The user can provide a path (a list of paths in Unix) in the
   METRICS environment variable.

In case the user does not provide a path, Font::AFM provides
a list of default paths.  There is no guarantee that AFM files
will reside in any of these default directories.  For example,
the Linux system sitting across the room has loads of AFM files,
but none in any of Font::AFM's default directories.

I think it is safe to say that the Mac adaptation does not have
to promise to find AFM files any more than the Unix adaptation.
The Fonts folder seems the most natural place to look if the
user doesn't specify a path.


Finally, "the AFM equivalent on a Mac" is found in the FOND
resource in a font's suitcase file. (I hope someone will correct
me if this has changed, what with the advent of GX fonts and
imminent arrival of OpenType fonts, oh my!)   I can see a good
argument for providing a Perl interface to the FOND resource. But
that would not be the same as parsing AFM files in a portable
way. I think Font::AFM -- with bug fixes -- has some use on the
Mac.


The patches I supplied do cause the system Font folder to be the
default directory for AFM files.  Assuming this is acceptable,
then rolling the changes into the original LWP source makes
sense for simpler maintenance.

As far as I know, the changes are safe for non-Mac platforms.

Thanks for the thoughtful comments!  I think the ball is back
in Paul and Matthias's court.

Jim



At 10:06 PM -0500 3/8/98, Paul J. Schinder wrote:
[discussion of G•sle Aas with Chris Nandor elided]
>Matthias added the code to find the Mac
>font directory, and it was I who deliberately left Font::AFM in full Unix
>mode in the first place . There were two reasons for this. First, at the
>time I had no idea where AFM fonts lived on a Mac. Second, and more
>important, I have no idea whether they're plain data fork files in the
>same format as their Unix cousins, and they will have to be in order for
>Font::AFM to work.
>
>I've saved the patch. Jim, if you can assure me that the patch actually
>works (i.e. you can both find the metrics files and *use them*) then I can
>roll it into my MacPerl port of LWP and send the patched file to Matthias.
>A quick look at my wife's G3 shows nothing that looks like an AFM on it,
>so my machines will be the same, and I won't have any way of testing this.
>(Frankly, I'm amazed that the AFM equivalent on a Mac isn't stuffed into
>the resource fork of the actual fonts file.)
>
>So long as there's a seperate Mac port of LWP, it's best to send bug
>reports to Matthias or me. We're the ones that will know whether or not
>the problem was our fault.
>
>-------
>Paul J. Schinder
>schinder@pobox.com
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch


--
Jim Miner          jfm@winternet.com           +1 612 729 1667



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch