I’m working on a script that allows me to switch between having vertical extreme points, and points with off curves at a certain angle (useful when working on italics, or other use cases where you want to quickly add non vertical/horizontal points in a consistent way), ex:
For now I’m doing this in a straightforward way: rotate the glyph, add extreme points, rotate back.
Then I need to: remove vertical nodes, remove nodes that were the horizontal extremes before rotating back the glyph.
My main issue with this is: having to delete points that were horizontal extremes which I never needed in the first place results in parts of the glyph with segments drawn differently when they shouldn’t have changed, ex: see top part of /a
My second issue is that sometimes when adding extremes on the rotated glyph, it doesn’t keep the previous extreme point from before rotation, resulting in things like this (bottom of counterform):
Rotated Glyph with new extreme points:
This doesn’t happen when I add the extreme point manually, only when I do it with
And finally, I end up with a lot of curve points with unaligned offcurves, like this:
So my questions are:
Is there a way to add extreme points with a condition? For example, only add vertical ones, or only add them on a selection of segments instead of a whole GSPath object?
how can I make sure that
addNodesAtExtremes()does not remove another point?
how can I force off curve points to keep their angle? (when deleting nodes manually, the keep shape feature is providing good results, as much as the original curve can be matched with the new node placement, but the results I have using
removeNodeCheckKeepShape_()does not seem to be the same. Am I using the right thing?