Blame README

Packit 2638f0
NAME
Packit 2638f0
    Font::AFM - Interface to Adobe Font Metrics files
Packit 2638f0
Packit 2638f0
SYNOPSIS
Packit 2638f0
     use Font::AFM;
Packit 2638f0
     $h = new Font::AFM "Helvetica";
Packit 2638f0
     $copyright = $h->Notice;
Packit 2638f0
     $w = $h->Wx->{"aring"};
Packit 2638f0
     $w = $h->stringwidth("Gisle", 10);
Packit 2638f0
     $h->dump;  # for debugging
Packit 2638f0
Packit 2638f0
DESCRIPTION
Packit 2638f0
    This module implements the Font::AFM class. Objects of this
Packit 2638f0
    class are initialised from an AFM-file and allows you to obtain
Packit 2638f0
    information about the font and the metrics of the various glyphs
Packit 2638f0
    in the font.
Packit 2638f0
Packit 2638f0
    All measurements in AFM files are given in terms of units equal
Packit 2638f0
    to 1/1000 of the scale factor of the font being used. To compute
Packit 2638f0
    actual sizes in a document, these amounts should be multiplied
Packit 2638f0
    by (scale factor of font)/1000.
Packit 2638f0
Packit 2638f0
    The following methods are available:
Packit 2638f0
Packit 2638f0
    $afm = Font::AFM->new($fontname)
Packit 2638f0
       Object constructor. Takes the name of the font as argument.
Packit 2638f0
       It will croak if the font can not be found.
Packit 2638f0
Packit 2638f0
    $afm->latin1_wx_table()
Packit 2638f0
       Returns a 256 element array, where each element contains the
Packit 2638f0
       width of the corresponding character in the iso-8859-1
Packit 2638f0
       character set.
Packit 2638f0
Packit 2638f0
    $afm->stringwidth($string, [$fontsize])
Packit 2638f0
       Returns the width of the string passed as argument. The
Packit 2638f0
       string is assumed to be encoded in the iso-8859-1 character
Packit 2638f0
       set. A second argument can be used to scale the width
Packit 2638f0
       according to the font size.
Packit 2638f0
Packit 2638f0
    $afm->FontName
Packit 2638f0
       The name of the font as presented to the PostScript language
Packit 2638f0
       `findfont' operator, for instance "Times-Roman".
Packit 2638f0
Packit 2638f0
    $afm->FullName
Packit 2638f0
       Unique, human-readable name for an individual font, for
Packit 2638f0
       instance "Times Roman".
Packit 2638f0
Packit 2638f0
    $afm->FamilyName
Packit 2638f0
       Human-readable name for a group of fonts that are stylistic
Packit 2638f0
       variants of a single design. All fonts that are member of
Packit 2638f0
       such a group should have exactly the same `FamilyName'.
Packit 2638f0
       Example of a family name is "Times".
Packit 2638f0
Packit 2638f0
    $afm->Weight
Packit 2638f0
       Human-readable name for the weight, or "boldness", attribute
Packit 2638f0
       of a font. Exampes are `Roman', `Bold', `Light'.
Packit 2638f0
Packit 2638f0
    $afm->ItalicAngle
Packit 2638f0
       Angle in degrees counterclockwise from the vertical of the
Packit 2638f0
       dominant vertical strokes of the font.
Packit 2638f0
Packit 2638f0
    $afm->IsFixedPitch
Packit 2638f0
       If the value is `true', it indicated that the font is a
Packit 2638f0
       fixed-pitch (monospaced) font.
Packit 2638f0
Packit 2638f0
    $afm->FontBBox
Packit 2638f0
       A string of four numbers giving the lower-left x, lower-left
Packit 2638f0
       y, upper-right x, and upper-right y of the font bounding box.
Packit 2638f0
       The font bounding box is the smallest rectangle enclosing the
Packit 2638f0
       shape that would result if all the characters of the font
Packit 2638f0
       were placed with their origins coincident, and then painted.
Packit 2638f0
Packit 2638f0
    $afm->UnderlinePosition
Packit 2638f0
       Recommended distance from the baseline for positioning
Packit 2638f0
       underline stokes. This number is the y coordinate of the
Packit 2638f0
       center of the stroke.
Packit 2638f0
Packit 2638f0
    $afm->UnderlineThickness
Packit 2638f0
       Recommended stroke width for underlining.
Packit 2638f0
Packit 2638f0
    $afm->Version
Packit 2638f0
       Version number of the font.
Packit 2638f0
Packit 2638f0
    $afm->Notice
Packit 2638f0
       Trademark or copyright notice, if applicable.
Packit 2638f0
Packit 2638f0
    $afm->Comment
Packit 2638f0
       Comments found in the AFM file.
Packit 2638f0
Packit 2638f0
    $afm->EncodingScheme
Packit 2638f0
       The name of the standard encoding scheme for the font. Most
Packit 2638f0
       Adobe fonts use the `AdobeStandardEncoding'. Special fonts
Packit 2638f0
       might state `FontSpecific'.
Packit 2638f0
Packit 2638f0
    $afm->CapHeight
Packit 2638f0
       Usually the y-value of the top of the capital H.
Packit 2638f0
Packit 2638f0
    $afm->XHeight
Packit 2638f0
       Typically the y-value of the top of the lowercase x.
Packit 2638f0
Packit 2638f0
    $afm->Ascender
Packit 2638f0
       Typically the y-value of the top of the lowercase d.
Packit 2638f0
Packit 2638f0
    $afm->Descender
Packit 2638f0
       Typically the y-value of the bottom of the lowercase p.
Packit 2638f0
Packit 2638f0
    $afm->Wx
Packit 2638f0
       Returns a hash table that maps from glyph names to the width
Packit 2638f0
       of that glyph.
Packit 2638f0
Packit 2638f0
    $afm->BBox
Packit 2638f0
       Returns a hash table that maps from glyph names to bounding
Packit 2638f0
       box information. The bounding box consist of 4 numbers: llx,
Packit 2638f0
       lly, urx, ury.
Packit 2638f0
Packit 2638f0
    $afm->dump
Packit 2638f0
       Dumps the content of the Font::AFM object to STDOUT. Might
Packit 2638f0
       sometimes be useful for debugging.
Packit 2638f0
Packit 2638f0
    The AFM specification can be found at:
Packit 2638f0
Packit 2638f0
       ftp://ftp.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PSfiles/5004.AFM_Spec.ps
Packit 2638f0
Packit 2638f0
ENVIRONMENT
Packit 2638f0
    METRICS   Contains the path to seach for AFM-files. Format is as for
Packit 2638f0
              the PATH environment variable. The default path built
Packit 2638f0
              into this library is:
Packit 2638f0
Packit 2638f0
               /usr/lib/afm:/usr/local/lib/afm:/usr/openwin/lib/fonts/afm/:.
Packit 2638f0
Packit 2638f0
BUGS
Packit 2638f0
    Kerning data and composite character data is not yet parsed.
Packit 2638f0
    Ligature data is not parsed.
Packit 2638f0
Packit 2638f0
COPYRIGHT
Packit 2638f0
    Copyright 1995-1998 Gisle Aas. All rights reserved.
Packit 2638f0
Packit 2638f0
    This program is free software; you can redistribute it and/or
Packit 2638f0
    modify it under the same terms as Perl itself.
Packit 2638f0