Skip to content

Instantly share code, notes, and snippets.

@mekkablue
Created July 27, 2019 16:54
Show Gist options
  • Save mekkablue/932792cc5fb29e05dccab52b807cede6 to your computer and use it in GitHub Desktop.
Save mekkablue/932792cc5fb29e05dccab52b807cede6 to your computer and use it in GitHub Desktop.
Open closed paths
#MenuTitle: Open closed paths
# -*- coding: utf-8 -*-
__doc__="""
Opens all paths in the visible layers of selected glyphs.
"""
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def process( thisLayer ):
pathCount = 0
for thisPath in thisLayer.paths:
if thisPath.closed:
thisPath.closed = False
pathCount += 1
return pathCount
Font.disableUpdateInterface()
print "Opening paths in %i glyphs:" % len( selectedLayers )
for thisLayer in selectedLayers:
print "-- %s: opened %i path(s)." % ( thisLayer.parent.name, process( thisLayer ) )
Font.enableUpdateInterface()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment