Straighten Handles Plugin

Is there a way to straighten handles to be vertical or horizontal in Glyphs? I can select and align them with cmd+shift+a but only averages the position.

Not being able to find i glued some code and made this demo:

straighten%20handles

  • It detects the implied axis,
  • only straightens handles within 10° from that axis,
  • leaves the on curve points untouched,
  • works only on smooth points,
  • translates the offcurve points perpendicularly to the detected axis,
  • works even if you only select one off curve point.

I’d love to see this implemented natively in Glyphs (if it’s not already there and i somehow missed it).
I’ll put it into a plugin tomorrow anyways.

You can already average positions. If you want a dedicated function, I would be interested in keeping the same shape.

1 Like

How do these kind of algorythms work? I’d be nice to see an example.

Just select multiple nodes and Align Selection (Shift+Command+A). Of course you need to select the nodes though.

I thought you meant that after aligning the shape would stay approximately the same or it will try at least.
Just like when you delete a node on a path and it tries to keep the shape by adjusting other nodes.

Shift+Command+A doesn’t do that for me.

What I meant is, if you don’t take the shape into account, there is already Align Selection for that. If you need to preserve the shape, then you need to add extreme first and delete the diagonal, for example.

I see now, adding extremes and deleting superfluous points might produce a result that resembles the previous shape better.

1 Like