Is there a Filter / Plugin, that deletes small Kerning within the instances when they are exported?
Example:
In Bold is a Kerning Pair that is -10
In Thin, this kerning Pair isn’t necessary, so it is 0.
→ The interpolated Regular has a Kerning Pair of -5.
How can I get that -5 removed in the Regular? “Delete Small Kerning Pairs” by @mekkablue only works for masters, not within the generated instances.
I know it is possible to create, but I am unable to write this script/filter/plugin.
You would need to write an export plugin that treats each exported instance separately. You can recreate this manually with the following steps:
In your Glyphs file, select “File → Generate Instances”
Run the “Delete Small Kerning Pairs” script
Export
You could otherwise create a Filter plugin that you can add as a custom parameter for each instance, but that’s not really the intended use of filters.
I never thought of that, good point. I’ll need to update my plugin that Moritz is referring to.
The idea is simply that small kerning pairs are perceived as noise (as in, having a -1 kerning pair in an exported font might well be seen as unwanted noise), so I remove all pairs absolutely smaller than 5 units in my exported instances.
From what I understand, filters rather pertain to the layers/outlines rather than the relations between layers (i.e. kerning). Of course, it works perfectly with a filter. Maybe just ignore my comment
I’m just writing the PreFilter to remove small kerning pairs, but I have a question. How can I run the filter once on export on the kerning, without it being triggered once for every layer? Currently, the filter code is run once for every layer, but I would like to run the filter only once.
Do I need to set some boolean variable once when the filter is run for the first time, and then switch it after running the filter, so that the filter is not run anymore for all the other layers? Is there a smarter way?