I’m trying to write a script which uses nearestPointOnPath_pathTime_
but when testing I got bizarrely wrong answers. Here’s aKaf.medi
from Khaled’s Amiri font.
In the Macro window, type:
Layer = Glyphs.font.selectedLayers[0]
print(Layer.paths[0].nearestPointOnPath_pathTime_(NSMakePoint(564,0), None))
Answer:
(<NSPoint x=551.0 y=731.0>, 26.0)
Converting to Cubic makes it work.
One workaround would be to duplicate the path and convert to cubic in script before running nearestPointOnPath_pathTime_
on it but I am not sure how to do that.