Pre-Interpolation filters?

Hello, is it possible to call a filter in an instance before it is interpolated?

For example: I have a font which uses different corner components between masters. I want to decompose them (because they are compatible) before the instance is interpolated.

I can of course simply run a filter on the whole font before exporting, but that’s annoying. Is there some way of setting this up as a parameter in the exports?

Yes, use a “PreInterpolationFilter” CP.

Okay, thanks. I couldn’t find that in the list. I knew there was something like PreInterpolationFilter, just didn’t realise it’s a hidden parameter.

Thanks!

I can’t get this to work.

This is my filter:

@objc.python_method
def filter(self, layer, inEditView, customParameters):
	for corner in layer.allCorners():
		layer.removeHint_(corner)

Even just writing print("Hello") doesn’t print anything when used as a PreInterpolationFilter.

My goal is to remove all corner components in all layers before interpolation. Is this doable?

Why before interpolation?
If you like to export without the corners, you can add a “Remove Glyphs” parameter that contains the corners.

Ah! That’s smart. Thanks.

How about for decomposing corners? I need to do this before interpolation, because the file has different corner components between masters (so, incompatible), but they are compatible after decomposition.

Does your filter work (meaning the print() shows) when run as a “Filter”?

Yes.

Can you try adding:

def processGlyph_withArguments_(self, glyph, arguments):

(without the @objc.python_method).

Excellent, that works. Thank you!