Scripting help: multi-axis interpolation best practice

Hello, I just wrote a new script for interpolating HT Letterspacer values, but I only got it to work for a single-axis setup. Can anybody help with some insight on how to best implement multiple-axis interpolation in the script? I’m somewhat lost, but it appears to me that I can wrap lines 162–169 in a for axisindex in len(Font.axes) loop, inserting axisindex instead of 0 and calculating the average (?) of the resulting values from each loop. Very shaky on the mathematics, though. Appreciate any pointers! Thanks :slightly_smiling_face:

What do you need those interpolated values for?
I would use an instance and get its instanceInterpolations. It contains a dict with masterIDs as keys and interpolation factors as values.

Ah, I didn’t know that, thank you very much!

I need the interpolated values in order to use HT Letterspacer on new masters. For example, I set up Letterspacer on Light and Bold, and decided to add a Heavy master. It’s annoying to calculate consistent parameters, the script does it automatically.

Essentially, it doesn’t matter that it’s HT Letterspacer, you could use the same script structure to interpolate kerning (Kernschmelze is the same concept, it was just a bit more messily programmed :wink: )

1 Like

You could also put those values into Master > Number Values. Then do “instance as master” (with a Black instance). that should interpolate the numbers.