freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Value of AFM Files (Postscript Type 1)


From: Nelson H. F. Beebe
Subject: Re: [Freetype] Value of AFM Files (Postscript Type 1)
Date: Fri, 10 May 2002 11:11:56 -0600 (MDT)

"Bertrand Chagny" <address@hidden> writes on Fri, 10 May 2002
15:57:20 +0200:

>> What is the best and fastest way to obtain metrics (the same
>> metrics you could find in an AFM file) from a PFB and a PFM file
>> with FreeType ?

In general, this is infeasible, and has nothing to do with freetype.

Type 1 fonts are implemented by two important files: the outline
descriptions (in .pfa or .pfb formats), and the metrics, kerning, and
ligature information (in .afm (or .pfm) files).

This separation is important:

(1) The first file contains sufficient information to describe each
    character in isolation from all others, and is needed only by
    software that ultimately renders text set in the font.

(2) The second file contains information needed to create strings of
    text whose glyphs are positioned relative to one another in a
    pleasing fashion, normally decided by the original font designer,
    and overridden only by typographically-abberant practices such as
    ``track kerning''.  This information is needed by typesetting
    systems to compose text: they need metrics, not shapes.

The .afm file format was sensibly designed to have a simple,
well-defined, and easily-parsed plain text format.  .pfm files contain
similar information, but in a compact binary form that is much more
difficult to deal with.  .pfm files tend to be relevant on Windows
platforms, but not elsewhere. For example, no TeXware that I'm aware
of makes any use whatever of .pfm files. [Please correct me if you
know of any such programs.]

Because the metrics are separate from the outlines, font vendors can
issue updated metric files that add for example, additional kerning
and/or ligature specifications, or tweak the character metrics in
minor ways to improve appearance.  Adobe has done this quite often.
Also, many font vendors, including Adobe, permit metric files to be
freely distributed (provided that their internal copyrights are not
modified), so users can freely download and install such updated files
without having to purchase new fonts.

This separation means that typesetting software, for example, can be
run on systems that lack licenses for font outlines: only when the
output is actually rendered for display are the outlines required.

However, it also has a downside: two users with the same outline
files, but different metric files, will get different typesetting
results.  

TeX deals with this possibility by recording in its output .dvi file
for each font, the font checksum that is recorded in the TeX font
metric (.tfm) files, as well as in the bitmap files (.pxl, .gf, .pk)
that describe character shapes.  

DVI drivers, whose job it is to convert .dvi files to rendered page
images, need the bitmap or outline files, and will warn if checksum
mismatches are detected.  This additional check is not possible with
Type 1 fonts, since there is no concept of a font checksum in that
format.

Try running t1disasm (available in

        http://www.lcdf.org/type/t1utils-1.26.tar.gz

) on a .pfa or .pfb file to get a better understanding of the
contents of outline files.  

You can find the full story in the black-and-white Adobe Type 1 font
book, which is also available electronically at the indicated URL:

@String{pub-AW                  = "Ad{\-d}i{\-s}on-Wes{\-l}ey"}
@String{pub-AW:adr              = "Reading, MA, USA"}

@Book{Adobe:1990:ATFb,
  author =       "{Adobe Systems, Inc.}",
  title =        "{Adobe} type 1 font format",
  publisher =    pub-AW,
  address =      pub-AW:adr,
  pages =        "iii + 103",
  year =         "1990",
  ISBN =         "0-201-57044-0, 0-471-92841-0",
  LCCN =         "QA76.73.P67 A36 1990",
  bibdate =      "Wed Feb 28 15:00:20 MST 1996",
  bibsource =    "ftp://ftp.math.utah.edu/pub/tex/bib/postscri.bib,
                 ftp://ftp.math.utah.edu/pub/tex/bib/master.bib";,
  price =        "US\$14.95, CDN\$18.95",
  URL =          "http://partners.adobe.com/asn/developer/pdfs/tn/T1_SPEC.PDF";,
  acknowledgement = ack-nhfb,
  annote =       "``Version 1.1''--Cover. ``New updated
                 information''--Cover. Includes index.",
  keywords =     "Adobe Type 1 font.; PostScript (Computer program
                 language)",
}

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
- University of Utah                    Internet e-mail: address@hidden  -
- Department of Mathematics, 110 LCB        address@hidden  address@hidden -
- 155 S 1400 E RM 233                       address@hidden                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]