Hi. I have a glyph with a mixed paths types – an already closed paths that I don’t want to touch, and unclosed paths with a stroke width which I want to expand. The design is pretty complicated and there are a lot of paths, so It’s not easy to manually select an unclosed ones.
Here’s what I tried:
for path in Layer.paths:
if not path.closed and path.attributes['strokeWidth']:
path.flattenOutlines()
An error:
'GSPath' object has no attribute 'flattenOutlines'
I also tried path.expandStroke() and path.expandedStroke() that also follow to a similar errors. I will be grateful for any help.
Thanks Sebastian.
Unfortunately, neither flattenendOutlines() / flattenedOutlines() nor expandedStroke() works at the moment, although the last one does not cause an error in the Macro.
Currently I use the following script to select all an unclosed paths with a stroke width, and then expand it manually. I’m fine with that.
Layer.clearSelection()
Glyphs.font.disableUpdateInterface()
for shape in Layer.shapes:
if not shape.closed and shape.attributes['strokeWidth']:
for node in shape.nodes:
Layer.selection.append(node)
Glyphs.font.enableUpdateInterface()