Created
July 27, 2019 16:50
-
-
Save mekkablue/b8361b5e579c09166153e436847d30b0 to your computer and use it in GitHub Desktop.
Close open paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#MenuTitle: Close open paths | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
Close all paths in visible layers of selected glyphs. | |
""" | |
Font = Glyphs.font | |
selectedLayers = Font.selectedLayers | |
def process( thisLayer ): | |
pathCount = 0 | |
for thisPath in thisLayer.paths: | |
if not thisPath.closed: | |
thisPath.closed = True | |
pathCount += 1 | |
return pathCount | |
Font.disableUpdateInterface() | |
print "Closing paths in %i glyphs:" % len( selectedLayers ) | |
for thisLayer in selectedLayers: | |
print "-- %s: closed %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