Key Characters when doing kerning

Is there an easy way to have persistent key characters when doing kerning using sample strings other than manually inserting them into the imported kern pair (sample strings) file? It would be very useful to be able to specify two on each side of a pair, perhaps as a Prefs setting.

What exactly do you mean by key characters?
You can use placeholders to repeat the current letter.

Key characters determine the base spacing for the entire font. So for the kern pair “VA” I would like to be able to display the key characters (2 or 3) of my choice. The key characters I use are HHOHOOO nnonooo 000.

HHVAHH or HOHVAHOH or nnvann or nonvanon.

I see what he wants. That is available in Metrics Machine. Placeholder is not quite what George wants I think, because it’s very tricky to kern with placeholders due to its changing behaviour.

George, I think this is only a matter of personal taste of how you want to build your own sample string. I can only advise you to just build exactly that text string (or buy Metrics Machine). I think it’s good to just make it since it’s easy and you are going to reuse the text in other projects; pairs like VA are usual suspects. I prefer to see the spaces in real words, and I have several words that contain it in my sample text as well as basic strings you use.

Thanks for your comments Tosche. You are right about Placeholders, too. I tried a demo of Metrics Machine and found that Glyphs kerning routine is more efficient for my way of working.

I did make a kern pair file as you mentioned and found that it works very well, and I did the same thing for Cyrillic which helped immensely. Strings of plaintext are there too, as a final check against the pairs.

I would just like to make it better (or easier) in Glyphs because I think it would help others too. That being said, if it would be a significant amount of work for Georg to implement, then there are other things that would be more important.

I think what you want to do can be achieved by a simple Python script. So, you always want HOH inserted after and before your current edit string?

ooh, that was a nice idea, just wrote a script that does it. as always, feel free to improve: https://github.com/DeutschMark/Glyphsapp-Scripts/tree/master

@mekkablue: one bug i just saw: if you have no tab open and run it with a selection from the font overview, the tab-bar will be missing. any clues about that?

You have to wrap the call to addTabWithString like this:

from PyObjCTools.AppHelper import callAfter
callAfter(Glyphs.currentDocument.windowController().addTabWithString_, tabText)

great, thanks! updated it on GitHub …

@mekkablue – It sounds like I would have to run the script each time a new pair appears in the Text window. That sounds less efficient than what I do now. Also, the persistent characters should change depending upon case.

@mark – Thanks for the script; I’ll try it.

@mark – Tried the script, and just as I expected it has to be run each time a user advances to the next kern pair.

A script isn’t the answer for what I think would be an improvement for users. Georg will have to code it into the app if it happens.

Or a script could detect what is displayed and change the text accordingly.

Unless you can make the key characters persistent, a script is going to have to be run each and every time a pair changes. That is not efficient. Too, you would have to either change the script or have a separate script for each key character set you might want to use.

What I think would be ideal would be to have a drop-down list of key character pairs or triplets such as one sees when adding a component so the user could select their key characters and change them as needed. They would persist when changing kern pairs (either typed or from a sample list) until the user changed them.

This is a bit complicated with the current implementation. I think about it.

Thanks Georg. It’s not something that’s needed urgently, just something that would be an improvement to Glyphs for the future. I have my kern files built with all the needed key characters but it would be still be useful.

you can have the script opening a little window with the default key characters, but you can also edit them before you hit enter to execute. can be solved with the dropdown. i am currently working on that. since my coding skills are still in development, it might take some days.

@Mark – Interesting. I look forward to seeing what you come up with. Thanks.

okay, i got it nearly finished. works like a charm to me. Now my question before uploading is: What sets of Key Characters would be nice to have?

So far I have in the dropdown menu:
–> HOno
which produces a Tab with your selected Glyphs in that way:

HHHHOOOO
nn
nnoooo

(while the star represents your selected Glyphs here)

and:
–> VAvs
–> 01:.
—>(),/
(which render the same kind of output as above)

i programmed it so, that these options must contrain 4 characters. So, any ideas for better Key character strings?

Mark, I think you have it right since you use the word glyphs, implying two or a pair represented by the asterisk.

In the dropdown, I would list these, again with the asterisk representing selected characters for kerning:
HHHH
OO
OO
OHHO
HH
nn
HHoo
OO
nn
OOoo
nn
nn
oo*oo

Can the user change the key characters in the script? That would be the ideal solution since there are going to be situations where it is necessary to have something other than Latin characters for keys. The user would have to establish their references using the names that Glyphs uses.