I have Glyphs 3 and Glyphs 2. But, it seems that accessing paths doesn’t work on Glyphs 3 but works in Glyphs 2. Could you explain me what could be the issue there? Thanks.
On Glyphs 3, I have this result:
A
<GSProxyShapes: 0x6000062c5280>
On Glyphs 2, I have this result, which is right:
A
(<GSPath 40 nodes and 24 segments>)
In Glyphs 3, the paths property of a layer can only be iterated but not modified. You can write a for loop that iterates over the paths of layer like so:
for path in Layer.paths:
print(path)
This iterates over the paths of the current layer.
To modify the paths of a layer (delete paths, insert new paths) in Glyphs 3, use the shapes property on a layer which contains all paths and components on a layer. You can iterate over the shapes of a layer like so:
for shape in Layer.shapes:
if shape.shapeType == GSShapeTypePath:
print("a path:", shape)
elif shape.shapeType == GSShapeTypeComponent:
print("a component:", shape)
Hello,
I’m also starting to learn to script on Glyphs with the same tutorial. Now i’m stuck on part 2 as the result is not updated yet. Can anyone please tell me how the code would look like to have the same results as in Glyphs 2?
Thanks