CID vs GID (Cont’d)

In yesterday’s CJK Type Blog post, I introduced and provided three Perl tools for listing the CIDs and GIDs in font resources:,, and In my continued effort to provide font developers with useful tools, I spent a few minutes this morning to enhance two of these tools, specifically and

First, the tool was changed so that it emits CIDs with a slash (“/”) prefix, which matches what the “-g” command-line option of various AFDKO tools expect when explicitly specifying CIDs, as opposed to GIDs.

Second, the tool was enhanced in two significantly ways. The first enhancement was to simply detect and properly handle the slash (“/”) prefix, which is shown in the example command line and its output below:

% |

The second enhancement was to add a “-n” command-line option. By default, each CID or CID range (or GID or GID range, when the output of the tool is piped into this tool) is output on a separate line, as shown above. When the “-n” command-line option is invoked, each CID or CID range is separated by a comma, making the result ready to be used as the argument of the “-g” command-line option that is supported by various AFDKO tools. Below is an example command line and its output:

% | -n

The tool is unchanged.

These minor enhancements are useful for my own font development work, and I hope that others also find them to be useful.

Comments are closed.