This should be easy but I can’t figure it out.
I am looking for nodes (which will be in various paths) that are close to each other at a given y. If they are within two units, I want to move one atop the other.
I’ve succeeded in identifying them, but I can’t figure out how to move them.
cutHeight=324 MyLayers=Glyphs.font.selectedLayers for layer in MyLayers: layer.connectAllOpenPaths() intersections = layer.intersectionsBetweenPoints((0,cutHeight),(layer.width,cutHeight)) for i in range(1,len(intersections)-1): xDiff = intersections[i+1].x-intersections[i].x node=intersections[i] if xDiff < 3: node.x += xDiff print "shifted", intersections[i], "by", xDiff
This gets me to the second to last line which nets a “can’t set attribute” error.