Skip to content

Commit df988c3

Browse files
committed
added variation of decompose corners that cleans up a little
1 parent e1e5566 commit df988c3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: decompose_corners_caps_clean_up.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#MenuTitle: Decompose Corners and Caps & clean up
2+
# -*- coding: utf-8 -*-
3+
__doc__="""
4+
An slightly expanded @mekkablue script that:
5+
Decomposes all corner and cap components in selected glyphs. Reports to Macro Window.
6+
"""
7+
8+
thisFont = Glyphs.font
9+
selectedLayers = thisFont.selectedLayers
10+
11+
def process( thisLayer ):
12+
count = len([h for h in Layer.hints if h.type in (CORNER,CAP) ])
13+
if count:
14+
thisLayer.decomposeCorners()
15+
thisLayer.cleanUpPaths()
16+
thisLayer.correctPathDirection()
17+
print "-- Decomposed %i caps and/or corners" % count
18+
19+
Glyphs.clearLog()
20+
for thisLayer in selectedLayers:
21+
thisGlyph = thisLayer.parent
22+
print "Processing", thisGlyph.name
23+
thisGlyph.beginUndo()
24+
process( thisLayer )
25+
thisGlyph.endUndo()

0 commit comments

Comments
 (0)