Hi there,
I need to delete all contours in a number of glyphs so they are empty. How can I do that to a Pyhton list of glyphs?
TIA
Hi there,
I need to delete all contours in a number of glyphs so they are empty. How can I do that to a Pyhton list of glyphs?
TIA
for glyph in glyphs:
for layer in glyph.layers:
layer.paths = None
for glyphName in glyphNames:
glyph = Font.glyphs[glyphName]
for layer in glyph.layers:
layer.paths = None
This will remove all paths in all layers. If you need to keep the outlines in layer copies, you need something like this:
for glyphName in glyphNames:
glyph = Font.glyphs[glyphName]
for master in font.masters:
layer = glyph.layers[master.id]
layer.paths = None
Cool, thanks.