Load kerning strings from file

Hi! In G2 it was possible to load kerning strings from a txt file (easy to update the strings once, and simply reload the file on multiple computers). Is this no longer possible in G3?

1 Like

How do you mean? I am not familiar with this feature, but this sounds like an ideal opportunity for a script. Can you describe how you want it to work? Maybe I can quickly write something.

This is from G2: the Open File button allows to select a .txt to be used as source for strings.

From what I can tell, this simply copies the text from the imported file, but does not dynamically update the text if the file is changed. Writing this in a script wouldn’t be too difficult: Just copy the contents of a .txt file into the sample strings, nothing more. Is that what you are looking for?

Then again, I can’t find the documentation for the sample strings in the Python doc, or in the core doc. Is this accessible? (@FlorianPircher)

In Glyphs 3, sample strings are stored as a list of dictionaries where each dictionary has two keys, name (the name of the sample string as shown in the sidebar in the sample string preferences) and text (the actual sample string).

Have a look at this code from the @mekkablue scripts that appends a new sample strings entry to the existing sample strings:

Yes. Having a file stored somewhere (sometimes even next to the source files) that can be updated and then locally loaded (even if not dynamically updated) seemed like a cleaner process. Not sure why that function has disappeared.

Thank you! I was looking at Rainer’s Sample String Maker, but didn’t find anything in that direction. Should have just checked the other script, too :wink:

I’ll have a look at this.

Over the years, I have put together a group of test files. I just copy the text and paste it into the kerning window–very easy