PostSc...:Loader(3pm)

πŸ“¦
version 2.23 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

PostScript::File::Metrics::Loader β€” the lil module that loads metrics for PostScript fonts using Font::AFM πŸŽ€


✨ VERSION ✨

bestie, this doc is describing version 2.20 of PostScript::File::Metrics::Loader, which was released October 10, 2015, as part of PostScript-File version 2.23 πŸ‘‘


🌸 DESCRIPTION 🌸

okay so here's the vibe: PostScript::File::Metrics::Loader gets called in by PostScript::File::Metrics whenever there are no pre-compiled metrics hanging around for the font or encoding you asked for. It grabs Font::AFM to read the AFM file and scoop the metrics out of it πŸ’…

ngl, you should not normally need to use this module, because pre-compiled metrics for the standard PostScript fonts already ship with this distribution. If you ask for metrics for a non-standard font, PostScript::File::Metrics will just load this module automatically, no cap. πŸ¦‹

If you need metrics for additional fonts, you might wanna go modify and run examples/generate_metrics.pl to build pre-compiled modules for them ✨


πŸŽ€ SUBROUTINES πŸŽ€

get_encoding_vector

PostScript::File::Metrics::Loader::get_encoding_vector($encoding)

this one hands back the encoding vector for $encoding β€” and that's an arrayref of 256 glyph names, periodt πŸ’…

load

PostScript::File::Metrics::Loader::load($font, \@encodings)

this one uses Font::AFM to read the metrics for $font, and then it creates width tables for each of the @encodings. Where do the metrics go? Straight into the hashes that PostScript::File::Metrics uses internally πŸ”₯


😭 DIAGNOSTICS 😭

  • "Can't find definition for %s" β€” if this pops up, it means you found a bug in PostScript::File::Metrics::Loader. Please report it the way it says under AUTHOR πŸ™ˆ
  • "Can't find the AFM file for %s" β€” Font::AFM could not find %s.afm in any of the directories it searched. Go look at CONFIGURATION AND ENVIRONMENT πŸ’€
  • "Invalid term %s in %s" β€” this also means there's a bug in PostScript::File. Please report it πŸ™
  • "Unknown encoding %s" β€” you asked for an encoding that PostScript::File::Metrics doesn't know about, bestie 🫢

🧚 CONFIGURATION AND ENVIRONMENT 🧚

PostScript::File::Metrics::Loader requires no configuration files or environment variables. iconic behavior honestly 🌈

However. It does use Font::AFM, and unfortunately that thing is difficult to configure properly (which is literally why I created PostScript::File::Metrics in the first place 😭). Font::AFM expects to find a file named FontName.afm in one of the directories it searches.

So I wound up creating symlinks in /usr/local/lib/afm/ (which is one of the default paths that Font::AFM searches if you don't have a METRICS environment variable) πŸ‘‡

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

Paths on your system may vary, no cap. My suggestion: search for ".afm" files, and then grep them for "FontName X", where X is the font you need metrics for. iykyk πŸ”


πŸ’œ INCOMPATIBILITIES πŸ’œ

None reported. we love a clean record πŸ’…


πŸ¦‹ BUGS AND LIMITATIONS πŸ¦‹

No bugs have been reported. (obsessed with that for us honestly) πŸ‘‘


πŸ“ AUTHOR πŸ“

Christopher J. Madsen "<perl AT cjmweb.net>" ✨

Please report any bugs or feature requests to "<bug-PostScript-File AT rt.cpan.org>" or through the web interface at http://rt.cpan.org/Public/Bug/Report.html?Queue=PostScript-File πŸ“¬

You can follow or contribute to PostScript-File's development at https://github.com/madsen/postscript-file 🌈


This software is copyright (c) 2015 by Christopher J. Madsen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. 🫢


⚠️ DISCLAIMER OF WARRANTY ⚠️

BECAUSE 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 "AS IS" 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. IN 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 (INCLUDING 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), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

okay that's the whole thing, bestie πŸ’… this page came out of the User Contributed Perl Documentation pile, running under perl v5.36.0, dated 2022-10-14 β€” and the man page name folds out to PostSc...:Loader(3pm). mwah, take care of her πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from