For those who make use of the extract-cids.pl, extract-gids.pl, or extract-names.pl tools, all of which are AFDKO tx tool filters and are included in AFDKO, and whose purpose is to list the glyphs in the specified font resource, I’d like to introduce a new tool, named glyph-list.pl, which combines their functionality, thus making font development simpler.
The following types of fonts can specified:
- A CIDFont resource
- A name-keyed Type 1 font (aka PFA)
- An ‘sfnt’ (TrueType or OpenType) font
By default, the glyphs in the specified font are listed as CIDs or glyph names, depending on whether the font is CID- or name-keyed. This is automatically detected. CIDs are always prefixed with a slash (“/”) character.
There are four command-line options that can be specified:
- -h (or -u): Display the tool’s usage
- -g: List glyphs as GIDs in lieu of CIDs or glyph names
- -r: List CIDs and GIDs as ranges
- -s: Output lists or ranges on a single line with a comma separator (so that it can be repurposed through Copy&Paste)
The main benefit of the “-s” option is so that the output can be repurposed, such as the argument of the “-g” option that is supported by many AFDKO tools.
Below are the results of executing this tool against one of the CID-keyed fonts that was produced during the Manipulating CID-Keyed Fonts Using AFDKO Tools workshop that took place at ATypI Hong Kong 2012 earlier this month:
% glyph-list.pl -r cidfont.ps
/0-/65534
Anyway, if you use those three tools, I encourage you to try this new version that replaces them. The next version of AFDKO will include this new tool, and will remove the three tools that it replaces.
Enjoy!