Indesign – List all glyphs and keep it "consistent" when modifying the font ...

Sebastian Nagel's picture

Dear readers,

i'm using an indesign script (not created by my, but from the internets) to output all glyphs of a font, identified by their Glyph ID (GID) in a document for comparison, testing and specimen.

the problem especially in the creation of a glyph list, while still bugfixing is: if i change my font, adding or deleting glyphs, and update the document with the new font version, the glyphs "shift" in their order: Let's say i had "ABC" inserted via their glyph indexes 100, 101, 102, and i then delete the glyphs 50 and 51 in my font file, the glyphs "reshuffle". So in the new version, the glyph numbers used by indesign of course stay the same, but they represent "CDE" now, resulting in a "mess" in my indesign glyph list :)

I'm not working with unicode, as lots of my glyphs don't have one, but are alternates adressed by various opentype features.

How do you work in this problem? Any script to shift the GIDs in indesign too? Do you have a way better approach when creating a glyph list in a layout program, while still working on the font?


jasonc's picture

Well certainly referencing GIDs is only going to lead to this problem. But as you noted, unicodes won't help. The only reference which would help in this situation would be for your script to refer to glyphs by glyph name. Unfortunately, I've reached the end of my InDesign knowledge here, and am not sure if that'd be even possible. :(

Sebastian Nagel's picture

thank you - i have come to that conclusion too ... the glyph name would be "unique" and independent from GID or unicode, but as far as i can see in glyph palette (and also from search tool for glyphs), it is not used by indesign.

So what i'd need is a script that looks for glyph IDs in the document, and add / subtract a value X to any GID it finds that is larger than Y (the position where i added / deleted a glyph) ... or accept that some of the work has to be done manually ;-)

Theunis de Jong's picture

The GID is the index number of the character in the font itself, and so of course they shift when you remove a character ... You can't have a not-consecutive list of indexes.

Unicode is a mapping from glyph index to a fixed code, so even when the glyph index itself changes, InDesign can still find the correct one. But if you rely on index alone, it cannot help you any further.
The same thing will happen when you change your font to another one: Unicode mapped characters will stay the same, un-mapped characters will change to the random glyph on that index position in the new font.

Either don't insert or remove glyphs anymore (which should not be a problem, after all no software in the world works solely with glyph indexes), or assign Unicodes in the Private Range to your glyphs. The latter will ensure InDesign, as well as all other software, can keep up with your editing.

(The former can be accomplished by leaving 'deleted' glyphs as blanks in their position, and only add new characters at the end.)

Syndicate content Syndicate content