I’m drawing a complex bit of lettering with lots of flourishes, which means that I’m placing a lot of nodes at extrema, then option+clicking all paths to add off curve nodes, then dragging them into curves. There are lots of path segments, and every one needs to be a curve. This gets a bit tedious.
Is there a faster way to do the conversion of straight to curved paths than the typical option+click? For example, is there a script I could run that would change all selected paths into curves? Even if this just placed the offcurve nodes, it would save a good bit of clicking around.
I found a partial post on this, but it lacked detail in how to make the final script work. Putting together what is there, I think this is close. However, it crashes Glyphs (v2) when I try to run it:
font = Glyphs.currentDocument.font layer = font.selectedLayers for path in layer.paths: if path.selected == True: for node in path.nodes: if node.type != GSCURVE: # aNode has to be set Index = node.index PreviousNode = path.nodes[Index-1] # add the off curve nodes newNode = GSNode() newNode.type = GSOFFCURVE newNode.position = NSMakePoint( PreviousNode.x + ((node.x-PreviousNode.x) / 3 * 2), PreviousNode.y + ((node.y-PreviousNode.y) / 3 * 2) ) path.insertNode_atIndex_(newNode, Index) newNode = GSNode() newNode.type = GSOFFCURVE newNode.position = NSMakePoint( PreviousNode.x + ((node.x-PreviousNode.x) / 3), PreviousNode.y + ((node.y-PreviousNode.y) / 3) ) path.insertNode_atIndex_(newNode, Index) # change the type of the selected node node.type = GSCURVE
If am trying to run the script on a path if it is selected. But, each time I do, Glyphs crashes.
What am I missing?
Thanks for any insights!