288 lines
6.1 KiB
HTML
288 lines
6.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of AFM</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>AFM</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2016-11-25<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Font::AFM - Interface to Adobe Font Metrics files
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Font::AFM;
|
|
$h = new Font::AFM "Helvetica";
|
|
$copyright = $h->Notice;
|
|
$w = $h->Wx->{"aring"};
|
|
$w = $h->stringwidth("Gisle", 10);
|
|
$h->dump; # for debugging
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module implements the Font::AFM class. Objects of this class are
|
|
initialised from an <FONT SIZE="-1">AFM </FONT>(Adobe Font Metrics) file and allow you to obtain information
|
|
about the font and the metrics of the various glyphs in the font.
|
|
<P>
|
|
|
|
All measurements in <FONT SIZE="-1">AFM</FONT> files are given in terms of units equal to
|
|
1/1000 of the scale factor of the font being used. To compute actual
|
|
sizes in a document, these amounts should be multiplied by (scale
|
|
factor of font)/1000.
|
|
<P>
|
|
|
|
The following methods are available:
|
|
<DL COMPACT>
|
|
<DT id="1">$afm = Font::AFM->new($fontname)<DD>
|
|
|
|
|
|
|
|
|
|
Object constructor. Takes the name of the font as argument.
|
|
Croaks if the font can not be found.
|
|
<DT id="2">$afm-><I>latin1_wx_table()</I><DD>
|
|
|
|
|
|
|
|
|
|
Returns a 256-element array, where each element contains the width
|
|
of the corresponding character in the iso-8859-1 character set.
|
|
<DT id="3">$afm->stringwidth($string, [$fontsize])<DD>
|
|
|
|
|
|
|
|
|
|
Returns the width of the argument string. The string is
|
|
assumed to be encoded in the iso-8859-1 character set. A second
|
|
argument can be used to scale the width according to the font size.
|
|
<DT id="4">$afm->FontName<DD>
|
|
|
|
|
|
|
|
|
|
The name of the font as presented to the PostScript language
|
|
<TT>"findfont"</TT> operator, for instance ``Times-Roman''.
|
|
<DT id="5">$afm->FullName<DD>
|
|
|
|
|
|
|
|
|
|
Unique, human-readable name for an individual font, for instance
|
|
``Times Roman''.
|
|
<DT id="6">$afm->FamilyName<DD>
|
|
|
|
|
|
|
|
|
|
Human-readable name for a group of fonts that are stylistic variants
|
|
of a single design. All fonts that are members of such a group should
|
|
have exactly the same <TT>"FamilyName"</TT>. Example of a family name is
|
|
``Times''.
|
|
<DT id="7">$afm->Weight<DD>
|
|
|
|
|
|
|
|
|
|
Human-readable name for the weight, or ``boldness'', attribute of a font.
|
|
Examples are <TT>"Roman"</TT>, <TT>"Bold"</TT>, <TT>"Light"</TT>.
|
|
<DT id="8">$afm->ItalicAngle<DD>
|
|
|
|
|
|
|
|
|
|
Angle in degrees counterclockwise from the vertical of the dominant
|
|
vertical strokes of the font.
|
|
<DT id="9">$afm->IsFixedPitch<DD>
|
|
|
|
|
|
|
|
|
|
If <TT>"true"</TT>, the font is a fixed-pitch
|
|
(monospaced) font.
|
|
<DT id="10">$afm->FontBBox<DD>
|
|
|
|
|
|
|
|
|
|
A string of four numbers giving the lower-left x, lower-left y,
|
|
upper-right x, and upper-right y of the font bounding box. The font
|
|
bounding box is the smallest rectangle enclosing the shape that would
|
|
result if all the characters of the font were placed with their
|
|
origins coincident, and then painted.
|
|
<DT id="11">$afm->UnderlinePosition<DD>
|
|
|
|
|
|
|
|
|
|
Recommended distance from the baseline for positioning underline
|
|
strokes. This number is the y coordinate of the center of the stroke.
|
|
<DT id="12">$afm->UnderlineThickness<DD>
|
|
|
|
|
|
|
|
|
|
Recommended stroke width for underlining.
|
|
<DT id="13">$afm->Version<DD>
|
|
|
|
|
|
|
|
|
|
Version number of the font.
|
|
<DT id="14">$afm->Notice<DD>
|
|
|
|
|
|
|
|
|
|
Trademark or copyright notice, if applicable.
|
|
<DT id="15">$afm->Comment<DD>
|
|
|
|
|
|
|
|
|
|
Comments found in the <FONT SIZE="-1">AFM</FONT> file.
|
|
<DT id="16">$afm->EncodingScheme<DD>
|
|
|
|
|
|
|
|
|
|
The name of the standard encoding scheme for the font. Most Adobe
|
|
fonts use the <TT>"AdobeStandardEncoding"</TT>. Special fonts might state
|
|
<TT>"FontSpecific"</TT>.
|
|
<DT id="17">$afm->CapHeight<DD>
|
|
|
|
|
|
|
|
|
|
Usually the y-value of the top of the capital H.
|
|
<DT id="18">$afm->XHeight<DD>
|
|
|
|
|
|
|
|
|
|
Typically the y-value of the top of the lowercase x.
|
|
<DT id="19">$afm->Ascender<DD>
|
|
|
|
|
|
|
|
|
|
Typically the y-value of the top of the lowercase d.
|
|
<DT id="20">$afm->Descender<DD>
|
|
|
|
|
|
|
|
|
|
Typically the y-value of the bottom of the lowercase p.
|
|
<DT id="21">$afm->Wx<DD>
|
|
|
|
|
|
|
|
|
|
Returns a hash table that maps from glyph names to the width of that glyph.
|
|
<DT id="22">$afm->BBox<DD>
|
|
|
|
|
|
|
|
|
|
Returns a hash table that maps from glyph names to bounding box information.
|
|
The bounding box consist of four numbers: llx, lly, urx, ury.
|
|
<DT id="23">$afm->dump<DD>
|
|
|
|
|
|
|
|
|
|
Dumps the content of the Font::AFM object to <FONT SIZE="-1">STDOUT. </FONT> Might sometimes
|
|
be useful for debugging.
|
|
</DL>
|
|
<P>
|
|
|
|
The <FONT SIZE="-1">AFM</FONT> specification can be found at:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
<A HREF="http://partners.adobe.com/asn/developer/pdfs/tn/5004.AFM_Spec.pdf">http://partners.adobe.com/asn/developer/pdfs/tn/5004.AFM_Spec.pdf</A>
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="24"><FONT SIZE="-1">METRICS</FONT><DD>
|
|
|
|
|
|
Contains the path to search for AFM-files. Format is as for the <FONT SIZE="-1">PATH</FONT>
|
|
environment variable. The default path built into this library is:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
/usr/lib/afm:/usr/local/lib/afm:/usr/openwin/lib/fonts/afm/:.
|
|
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
|
|
|
|
Kerning data and composite character data are not yet parsed.
|
|
Ligature data is not parsed.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 1995-1998 Gisle Aas. All rights reserved.
|
|
<P>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the same terms as Perl itself.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="25"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="26"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="27"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="28"><A HREF="#lbAE">ENVIRONMENT</A><DD>
|
|
<DT id="29"><A HREF="#lbAF">BUGS</A><DD>
|
|
<DT id="30"><A HREF="#lbAG">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:43 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|