The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

PostScript::DecodeGlyphName - PostScript glyph name to Unicode conversion

SYNOPSIS

 use PostScript::GlyphToUnicode file => '/usr/doc/PostScript/aglfn13.txt';
 print PostScript::GlyphToUnicode::map('Euro'), "\n";

DESCRIPTION

This module implements (most of) the PostScript glyph name to Unicode codepoint conversion algorithm as described by Adobe at http://partners.adobe.com/asn/tech/type/unicodegn.jsp.

To do something more than marginally useful with this module you will need to download the Adobe Glyph List from http://partners.adobe.com/asn/tech/type/glyphlist.txt.

INTERFACE

parse_adobeglyphlist

This function parses an Adobe Glyph List file and returns true on success. On failure, it returns false and supplies an error message in the package variable $ERROR. It expects its first argument to specify how to retrieve the data. The following options exist:

file

Takes the name of a file containing the Adobe Glyph List.

fh

Takes a filehandle reference that should be open on a file containing the Adobe Glyph List.

array

Takes an array reference. Each array element is expected to contain one line from the Adobe Glyph List.

data

Takes a scalar that is expected to contain the entire Adobe Glyph List file.

For convenience, you can pass the same parameters to the module's import() function, as exemplified in "SYNOPSIS". It will croak if it encounters any errors.

decode_glyph

This function takes a list of strings, each containing whitespace separated PostScript glyphs, and returns them concatenated as a single character string.

(You may want to memoize this function when processing large PostScript documents.)

LIMITATIONS

The decode_glyph function does not take the font into account and therefore will produce incorrect results for glyphs from the ZapfDingbats font.

AUTHOR

Aristotle Pagaltzis <pagaltzis@gmx.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Aristotle Pagaltzis.

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