I am using @loicsander’s RoboFab pens, particularly the broad nibber as it produces better results at the moment.
I want to create a plugin that takes an open outline from the front window and draws it’s Broad Nib counterpart in the background.
I can get an objectsGS.RGlyph but I don’t know how to use this for the drawBackgroundForLayer_ in a .glyphsReporter? Kind of like show Offset preview but for Broad nib
That is possibel but not implemented. You could implement a path.draw(pen) methods that traverses the bezierpath and draws itself in the pen. Have a look at the NSBezierPath documentation from Apple.
I do not think it is possible easily, you would have to get your hands dirty and wade through the path elements. You can step across its path elements with the NSBezierPath.elementCount() and NSBezierPath.elementAtIndex_() attributes. The latter will yield a NSBezierPathElement object, which you could query for its attributes and points, and step by step, reconstruct a GSPath with it.
That’s what I assumed. NSBezierPath.elementCount() and NSBezierPath.elementAtIndex_()where the missing pieces. Good to know. Will postpone to write a Pen for that. Thank you so much guys.
OR: do you mean, you want to draw a shape/Path to the background of the view? Like the reporters are capable of doing? In that case, why bother with the getPen? This is for drawing paths to the glyph/layer. Something kind of different.
thanks Mark! I just couldn’t find the glyphs app way of doing it!
I also wanted to use Loic Sander’s broadnibbing pen for something else https://github.com/loicsander/RobofabPens
I see. Then you are perhaps right to use the RoboFab pen. Unfortunately I’ll have to pass on the question and come over to the side of the curious ones. This is beyond my current knowledge.