~ubuntu-branches/debian/jessie/libfont-afm-perl/jessie

« back to all changes in this revision

Viewing changes to AFM.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jay Bonci
  • Date: 2004-11-10 13:45:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041110134516-6hwys0c615q9ezzz
Tags: 1.19-1
* New maintainer. (Closes: #279785)
* Changed section from interpreters to perl
* Bumped policy-version to 3.6.1
* New upstream version
* Added debian/watch file
* Changed to my standard rules template
* Moved to debhelper 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This -*- perl -*-  module is a simple parser for Adobe Font Metrics files.
2
 
# $Id: AFM.pm,v 1.18 1999/01/30 11:04:36 aas Exp $
 
2
# $Id: AFM.pm,v 1.19 2004/01/08 12:48:50 gisle Exp $
3
3
 
4
4
package Font::AFM;
5
5
 
19
19
=head1 DESCRIPTION
20
20
 
21
21
This module implements the Font::AFM class. Objects of this class are
22
 
initialised from an AFM-file and allows you to obtain information
 
22
initialised from an AFM (Adobe Font Metrics) file and allow you to obtain information
23
23
about the font and the metrics of the various glyphs in the font.
24
24
 
25
25
All measurements in AFM files are given in terms of units equal to
33
33
 
34
34
=item $afm = Font::AFM->new($fontname)
35
35
 
36
 
Object constructor. Takes the name of the font as argument. It will
37
 
croak if the font can not be found.
 
36
Object constructor. Takes the name of the font as argument.
 
37
Croaks if the font can not be found.
38
38
 
39
39
=item $afm->latin1_wx_table()
40
40
 
41
 
Returns a 256 element array, where each element contains the width
 
41
Returns a 256-element array, where each element contains the width
42
42
of the corresponding character in the iso-8859-1 character set.
43
43
 
44
44
=item $afm->stringwidth($string, [$fontsize])
45
45
 
46
 
Returns the width of the string passed as argument. The string is
 
46
Returns the width of the argument string. The string is
47
47
assumed to be encoded in the iso-8859-1 character set.  A second
48
48
argument can be used to scale the width according to the font size.
49
49
 
60
60
=item $afm->FamilyName
61
61
 
62
62
Human-readable name for a group of fonts that are stylistic variants
63
 
of a single design. All fonts that are member of such a group should
 
63
of a single design. All fonts that are members of such a group should
64
64
have exactly the same C<FamilyName>. Example of a family name is
65
65
"Times".
66
66
 
67
67
=item $afm->Weight
68
68
 
69
69
Human-readable name for the weight, or "boldness", attribute of a font.
70
 
Exampes are C<Roman>, C<Bold>, C<Light>.
 
70
Examples are C<Roman>, C<Bold>, C<Light>.
71
71
 
72
72
=item $afm->ItalicAngle
73
73
 
76
76
 
77
77
=item $afm->IsFixedPitch
78
78
 
79
 
If the value is C<true>, it indicated that the font is a fixed-pitch
 
79
If C<true>, the font is a fixed-pitch
80
80
(monospaced) font.
81
81
 
82
82
=item $afm->FontBBox
90
90
=item $afm->UnderlinePosition
91
91
 
92
92
Recommended distance from the baseline for positioning underline
93
 
stokes. This number is the y coordinate of the center of the stroke.
 
93
strokes. This number is the y coordinate of the center of the stroke.
94
94
 
95
95
=item $afm->UnderlineThickness
96
96
 
137
137
=item $afm->BBox
138
138
 
139
139
Returns a hash table that maps from glyph names to bounding box information.
140
 
The bounding box consist of 4 numbers: llx, lly, urx, ury.
 
140
The bounding box consist of four numbers: llx, lly, urx, ury.
141
141
 
142
142
=item $afm->dump
143
143
 
149
149
 
150
150
The AFM specification can be found at:
151
151
 
152
 
   ftp://ftp.adobe.com/pub/adobe/DeveloperSupport/TechNotes/PSfiles/5004.AFM_Spec.ps
 
152
   http://partners.adobe.com/asn/developer/pdfs/tn/5004.AFM_Spec.pdf
153
153
 
154
154
 
155
155
=head1 ENVIRONMENT
158
158
 
159
159
=item METRICS
160
160
 
161
 
Contains the path to seach for AFM-files.  Format is as for the PATH
 
161
Contains the path to search for AFM-files.  Format is as for the PATH
162
162
environment variable. The default path built into this library is:
163
163
 
164
164
 /usr/lib/afm:/usr/local/lib/afm:/usr/openwin/lib/fonts/afm/:.
168
168
 
169
169
=head1 BUGS
170
170
 
171
 
Kerning data and composite character data is not yet parsed.
 
171
Kerning data and composite character data are not yet parsed.
172
172
Ligature data is not parsed.
173
173
 
174
174
 
187
187
use strict;
188
188
use vars qw($VERSION @ISOLatin1Encoding);
189
189
 
190
 
$VERSION = sprintf("%d.%02d", q$Revision: 1.18 $ =~ /(\d+)\.(\d+)/);
 
190
$VERSION = sprintf("%d.%02d", q$Revision: 1.19 $ =~ /(\d+)\.(\d+)/);
191
191
 
192
192
 
193
193
# The metrics_path is used to locate metrics files