Deleting kernigpairs with 0 (zero) as value

I am working on a condensed font which was made narrower by using an external programm. Spacing and kerning was altered with the same percentages.

I am now cleaning up the kerning and getting a lot of obsolete pairs. They now have 0 (zero) as kerning value.

Would it be possible to select all those pairs at once and then delete them ? I could find any script or menu item to do this.

I agree this would be a great thing. My suggestion is to make it possible to sort the kerning pairs in alphabetic order, so it would be easy to see all zero’s or -1, -2 etc and just select and delete them. Maybe just with an arrow, sortin them in descending or ascending order?

1 Like

@lettersfromswe That would be a great help to start with. But more I think more editing possibilities in the kerning list would a great help.

When working with FL, I used to edit the metrics with external editors like BBedit or excel. So if the kerning/metrics could exported and imported, this would make some stuff easier.

In Glyphs 2 you can ex/import a .metics (File > Export… > Metrics, File > Import… > Metrics…)

1 Like

Oh !
I only found out about exporting the metrics as .csv, which could not be imported.

If I alter the exported metrics, I can import them again and it will taken over the changes ? Can you also decide to only import Spacing for example ?

I had a look, but the exported metrics are for one Master, right ?

Yes, you need to do that for each master.

What version of Glyphs do you have?

2.0 (711)

Another question. Can I mix up the order ? Does the kerning have to be alphabatical ?

the order is not important.

Georg, I will mention one of my old wishes again: please add the possibility to sort kerning pairs according their values. It would help you to identify accidentally inserted values like -250 and it could make it easier to delete pairs with values like 1 or -1. Thanks :wink:


I’m working on it. It will en extra tool for now, not in the existing kerning panel.

1 Like

I’ve been meaning to upload my scripts folder for a while now but for now here’s a Github gist exactly for this situation, it will delete all kerning pairs smaller than whatever you put in, in absolute value, i.e. if you put in 1: anything between (and including) 1 and -1 would both be deleted. If you want to delete all 0 value kerning pairs, just put 0 in.

Hi Georg,
I have tried it and it didn’t work as expected.

After editing kerning I exported the metrics as you suggested. After replacing the semicolon’s (:wink: in BBedit with tabs, I opened the file in Excel. I sorted the kerning and – in this case – only deleted the pairs with zero value. Then I replaced the tabs with semicolon’s and imported the file in Glyphs. In the list of import possibilities, I only marked “kerning”.

But all the deleted pairs are still there !

(To delete the pairs I could use @oneweioranother’s script, but I am now talking about editing possibilities.)

Sounds like something for MetricsMachine then?

No. I am fine with the spacing and kerning possibilities of Glyphs. But I would like to have the possibility to work in a text editor of choice if necessary.

The font I am working on was based on an existing one and therefore I ended with a lot of zero pairs. Going through the complete list of kerning to delete them is unhandy.

You know that you can open a .glyphs file in a text editor? Search for kerning = { and look for lines that end in = 0;. TextWrangler has an option to delete lines containing a certain search string.

I did, but somehow Glyphs didn’t notice the changes when importing back the file.

Don’t import. Close the file in Glyphs, do your edits in your favourite text editor, and open the file again in Glyphs. Make sure there is no Autosave version next to the file.

Off course ! Mix up :slight_smile:
I was still talking about the .metrics file …

You need to delete all kerning befor you import the .metrics file.

Ah, ok. Thanks.