Page 1 of 1

Modifying glyph names

Posted: Tue Jan 31, 2017 9:50 pm
by MikeW
I make use of being able to copy glyph names for manipulation every single day, multiple times per day. I have some macros and spreadsheets where most of my OT Feature stuff is written, then copied into the text editor to swap out tabs for spaces, ready to be pasted into the feature. Works great and is fast if more than a few glyphs are involved.

What I would now like to request is being able to paste glyph names into selected glyphs.

I have a current font with between 6 and 13 variations for every single main glyph. So a thousand or so variations to rename. It takes a bit to use the glyph properties dialog box, highlight something as meaningful as glyph678, type a.1 or whatever, press enter, use the mouse to select the next glyph and rinse & repeat for what seems like forever.

As the Copy/paste of glyph names uses a paragraph return for each name, perhaps Erwin could see the text on the clipboard and with a paste, each name could be changed, one glyph per paragraph?

Or, even if a script needed to be used.

I do use a script to both create empty glyphs and name them. But it only works when I am in control of the project from the beginning. I have, in the past, used my script to create more glyphs at the end of the current glyphs, then copy and paste the outlines/metrics into them, then delete the original glyphs. But that is more prone to error (as I found out, it's easy to get lost) and the proposed method would be cleaner/more simple to my thinking.

Mike

Re: Modifying glyph names

Posted: Tue Mar 07, 2017 8:28 am
by Erwin Denissen
We intend to add a search and replace for glyph names with support for regular expressions. This is not exactly what you request, but it might help.

Re: Modifying glyph names

Posted: Tue Mar 07, 2017 2:51 pm
by MikeW
I am uncertain how a single f/r for glyph names will aid anyone much less myself.

So I would prefer my original request stand. Thank you.

Re: Modifying glyph names

Posted: Tue Mar 07, 2017 3:12 pm
by Erwin Denissen
MikeW wrote:I am uncertain how a single f/r for glyph names will aid anyone much less myself.
With regular expressions it allows you to quickly change part of a name into something else. We should provide some examples to get novice people started, but I'm sure some people will benefit from it.
MikeW wrote:So I would prefer my original request stand. Thank you.
Point taken :wink:

Re: Modifying glyph names

Posted: Tue Apr 04, 2017 2:15 pm
by BabelStone
MikeW wrote:What I would now like to request is being able to paste glyph names into selected glyphs.
I would also very much welcome some way to batch change glyph names. For me the most useful feature would be to open glyph names in a simple text editor (similar to how the OpenType features can be edited as a text file), and/or ability to import/export glyph names as a text file.

Re: Modifying glyph names

Posted: Tue Apr 04, 2017 5:41 pm
by PJMiller
Regular Expressions are very powerful at pattern matching.

This should be well up to any ways you want to modify glyph names.

Re: Modifying glyph names

Posted: Thu Apr 06, 2017 2:25 pm
by MikeW
PJMiller wrote:Regular Expressions are very powerful at pattern matching.

This should be well up to any ways you want to modify glyph names.
As mentioned in the opening post, we can copy glyph names and paste into a text file. They end up one line per name.

Which would be easier, writing a regex and hopefully catching the pattern, if not catching all the correct glyphs and or catching to broadly, closing the project without saving, reloading the project (because there is no Revert to Saved in the file menu), tweaking the regex, applying it, again reviewing it...

Or, simply copying the modified names from a tweaked text file and pasting the result back to FC?

I'm pretty good with regex--I use it in ID and my programming editor. But I think I know which of the two scenarios above are faster.

Re: Modifying glyph names

Posted: Thu Apr 13, 2017 5:27 pm
by Erwin Denissen
We'll probably add both options.

Re: Modifying glyph names

Posted: Mon Apr 24, 2017 1:30 am
by MikeW
Excellent. Thanks, Erwin.

Mike