.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PostScript::File::Metrics::Loader 3pm" .TH PostScript::File::Metrics::Loader 3pm "2022-10-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PostScript::File::Metrics::Loader \- Load metrics for PostScript fonts using Font::AFM .SH "VERSION" .IX Header "VERSION" This document describes version 2.20 of PostScript::File::Metrics::Loader, released October 10, 2015 as part of PostScript-File version 2.23. .SH "DESCRIPTION" .IX Header "DESCRIPTION" PostScript::File::Metrics::Loader is used by PostScript::File::Metrics when no pre-compiled metrics are available for the requested font or encoding. It uses Font::AFM to read the \s-1AFM\s0 file and extract metrics from it. .PP You should not normally need to use this module, since pre-compiled metrics for the standard PostScript fonts are included with this distribution. If you request metrics for a non-standard font, PostScript::File::Metrics will load this module automatically. .PP If you need metrics for additional fonts, you may want to modify and run \fIexamples/generate_metrics.pl\fR to create pre-compiled modules for them. .SH "SUBROUTINES" .IX Header "SUBROUTINES" .SS "get_encoding_vector" .IX Subsection "get_encoding_vector" .Vb 1 \& PostScript::File::Metrics::Loader::get_encoding_vector($encoding) .Ve .PP This returns the encoding vector for \f(CW$encoding\fR, an arrayref of 256 glyph names. .SS "load" .IX Subsection "load" .Vb 1 \& PostScript::File::Metrics::Loader::load($font, \e@encodings) .Ve .PP This uses Font::AFM to read the metrics for \f(CW$font\fR, and creates width tables for each of the \f(CW@encodings\fR. The metrics are stored into the hashes used internally by PostScript::File::Metrics. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .ie n .IP """Can\*(Aqt find definition for %s""" 4 .el .IP "\f(CWCan\*(Aqt find definition for %s\fR" 4 .IX Item "Cant find definition for %s" If this happens, it indicates you found a bug in PostScript::File::Metrics::Loader. Please report it as described under \*(L"\s-1AUTHOR\*(R"\s0. .ie n .IP """Can\*(Aqt find the AFM file for %s""" 4 .el .IP "\f(CWCan\*(Aqt find the AFM file for %s\fR" 4 .IX Item "Cant find the AFM file for %s" Font::AFM could not find \fI\f(CI%s\fI.afm\fR in any of the directories it searched. See \*(L"\s-1CONFIGURATION AND ENVIRONMENT\*(R"\s0. .ie n .IP """Invalid term %s in %s""" 4 .el .IP "\f(CWInvalid term %s in %s\fR" 4 .IX Item "Invalid term %s in %s" This also indicates a bug in PostScript::File. Please report it. .ie n .IP """Unknown encoding %s""" 4 .el .IP "\f(CWUnknown encoding %s\fR" 4 .IX Item "Unknown encoding %s" You asked for an encoding that PostScript::File::Metrics doesn't know about. .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" PostScript::File::Metrics::Loader requires no configuration files or environment variables. .PP However, it uses Font::AFM, and unfortunately that's difficult to configure properly (which is why I created PostScript::File::Metrics in the first place). Font::AFM expects to find a file named \&\fIFontName.afm\fR in one of the directories it searches. .PP I wound up creating symlinks in \fI/usr/local/lib/afm/\fR (which is one of the default paths that Font::AFM searches if you don't have a \&\f(CW\*(C`METRICS\*(C'\fR environment variable): .PP .Vb 10 \& Courier.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/courier/pcrr8a.afm \& Courier\-Bold.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/courier/pcrb8a.afm \& Courier\-BoldOblique.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/courier/pcrbo8a.afm \& Courier\-Oblique.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/courier/pcrro8a.afm \& Helvetica.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/helvetic/phvr8a.afm \& Helvetica\-Bold.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/helvetic/phvb8a.afm \& Helvetica\-BoldOblique.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/helvetic/phvbo8a.afm \& Helvetica\-Oblique.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/helvetic/phvro8a.afm \& Symbol.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/symbol/psyr.afm \& Times\-Bold.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/times/ptmb8a.afm \& Times\-BoldItalic.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/times/ptmbi8a.afm \& Times\-Italic.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/times/ptmri8a.afm \& Times\-Roman.afm \& \-> /usr/share/texmf\-dist/fonts/afm/adobe/times/ptmr8a.afm .Ve .PP Paths on your system may vary. I suggest searching for \f(CW\*(C`.afm\*(C'\fR files, and then grepping them for \*(L"FontName X\*(R", where X is the font you need metrics for. .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" None reported. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" No bugs have been reported. .SH "AUTHOR" .IX Header "AUTHOR" Christopher J. Madsen \f(CW\*(C`\*(C'\fR .PP Please report any bugs or feature requests to \f(CW\*(C`\*(C'\fR or through the web interface at . .PP You can follow or contribute to PostScript-File's development at . .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2015 by Christopher J. Madsen. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE \*(L"AS IS\*(R" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.\s0 .PP \&\s-1IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE\s0 (\s-1INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0