Interpolate kerning

When I got a “light”, a “regular” and a “black” master, and I’ve already kerned “light” and “black”, is there a way to generate interpolated values for “regular”?

By the way:
I need the “regular” to better control the shapes.
importing kerning from a generated .otf won’t work, because classes and nice-naming of the cyrillic letters will be renamed in final .otf (even without choosing “production glyph names”)

Make a copy of the file. Remove the regular master and just interpolate the Regular. Create the regular instance, then copy the kerning into the regular master of the original 3-Master file.

thanks for your fast reply!
I did that already: unfortunately when interpolating the regular (by exporting .otf) the interpolated font-file has changed kerning-groups and glyph-names:
– the nice-named “de-cy” becomes “decy”
– and it’s left-kerning class changes from “de-cy” to “de-cy” as well and more over its right class “tse-cy” turns to a class named “H”
–> so more than 1/3 of kernpairs can not be copied to the original 3-master file (as its data is not the same any more)

Instead of interpolating the regular by exporting .otf you should interpolate it through Font > Generate Instances.

FWIW, I personally think Generate Instances should allow me to select the one(s) I want. In practice I almost always want only one instance generated. Having to close all others can be a bit of a hassle.

jakob_runge
Tim is right. Don’t export an OTF.

TimAhrens
You can select all instances in the Font Info, and deactivate the “is active” option. (I haven’t tried, but I think you can also trigger the generation of the instance via Python.)

Font > generate instance : great! Thanks for the tip.

mekkablue:

Seems more complicated than closing all but one window.

TimAhrens
Not if you do it 50 times in a row.

I don’t understand why you would use Generate Instances 50 times in a row. Can you explain a scenario?

I recently needed to do it more often in a row because I needed to see if a custom parameter and the recalculation of the features would work as expected. I didn’t count, but I admit it was certainly less than 50 times. :slight_smile:

I would love to have a customer parameter that would, at export, interpolate kerning for the middle masters from the extreme masters. Something like “interpolate kerning from extremes”

What do you think?

2 Likes

Do you know about my plugin »Kernschmelze«? It comes along with the Kernkraft plugin. It needs 2 masters having kerning and you can assign the other masters to either copy or interpolate the kerning. It doesn’t work as a Custom Parameter (yet, AFAIK), but it’s just a few clicks. So maybe just applying kerning to the other masters once in a while is bringing you far enough?!

BTW: It evens out the number of kerning pairs. So if one master has more pairs than the other, the one with less pairs will get new pairs with the value 0. This is nessessary to interpolate.

Can a Custom Parameter script access the original source font (i.e. the masters)? I had the impression this is not possible (maybe with a hack).

Not as a Filter or Prefilter, but we are thinking about a third option for cases like this.

1 Like

Thanks mark,

Does it round off kerning values differently from Glyphs?
If I interpolate kerning in glyphs, by removing the intermediate master and generating an instance, kerning for AV is -156, and if I do it with Kernschmelze, kerning for AV is -155. all the values are +1 in kerning output by Kernschmelze.

It uses the basic interpolation formula:

a + f * (b - a)

Where f is the position on the interpolation axis. The kern values a and b are integers themselve, but the result will still mostly be a float due to f. So this is probably the point where I need to implement the same rounding that Glyphsapp uses. Thanks for reporting, @Rui_Abreu

@GeorgSeifert @mekkablue : Should I round up or down in this case?

Are you sure with the int/float thing? Can you try to convert everything to float before? Otherwise, I do the same than you. It might be still be a float precision problem.

No, actual not sure. I thought so, since f comes from the interpolation between two masters. But now that you ask, I think they are indeed integers.

I will try to convert them to floats before and see what happens.

1 Like

would love that