Scaling paths with python


I’d like to scale paths by some percentage. Can I use Transformations filter?

I tried this but it didn’t work: NSClassFromString(“GlyphsFilterTransformations”)
it returns None.

What should I do? Is there another tool to do this?


The easies would be to iterate over the nodes and scale them yourself. That gives you the most control.
Something like (written in Safari):

for node in Path.nodes:
    pos = node.position
    pos.x = pos.x * 1.02 # scale up by 2 %
    node.position = pos

Thank You, this will do the job. But Transformations filter is not available via script, is it?

The Filter is called only ‘Transformations’. So NSClassFromString("Transformations") should work