PostScript::PrinterFontMetrics - module to fetch data from Printer Font Metrics files |
PostScript::PrinterFontMetrics - module to fetch data from Printer Font Metrics files
my $info = new PostScript::PrinterFontMetrics (filename, options); print STDOUT ("Name = ", $info->FontName, "\n"); print STDOUT ("Width of LAV = ", $info->kstringwidth("LAV", 10), "\n");
This package allows printer font metric files for PostScript files (so
called .pfm
files) to be read and (partly) parsed. PFM files
contain information that overlaps with that contained in AFM files and
can be used with the font files to generate missing AFM files.
How errors must be handled. Default is to call die().
In any case, new()
returns a undefined result.
Setting 'error' to 'ignore' may cause surprising results.
Note: Most of the info from the PFM file can be obtained by calling
a method of the same name, e.g. dfMaxWidth
and etmCapHeight
.
Fields that overlap with fields in the AFM file are also available
using the AFM name, e.g. etmCapHeight
can be referred to as
CapHeight
, and PostScriptName
as FontName
.
Each of these methods returns undef
if the corresponding
information could not be found in the file.
new
method.
This module also inherits methods from PostScript::FontMetrics.
PFM files contain information that overlaps with AFM files, including character widths and kerning pairs.
The PFM file specification is available in the Microsoft Windows Device Development Kit (DDK) (for Windows 3.1), however I have been unable to locate this document. Details of the structure of PFM were gleaned from an Adobe technical note and by examining sample PFM files.
Andrew Ford, Ford & Mason Ltd <A.Ford@ford-mason.co.uk>
This module draws heavily on the PostScript::FontMetrics
module by
Johan Vromans.
This program is Copyright 2001 by Andrew Ford and Ford & Mason Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the ``Artistic License'' which comes with Perl.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.
PostScript::PrinterFontMetrics - module to fetch data from Printer Font Metrics files |