Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39f0085

Browse files
committed
smoothness example
1 parent 5f9b717 commit 39f0085

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

glyphs/smoothPoints.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# get the current glyph
2+
g = CurrentGlyph()
3+
4+
# start an undo recorder
5+
g.prepareUndo("Smooth points")
6+
7+
# loop over all contours
8+
for c in g:
9+
# loop over all points
10+
for p in c.points:
11+
# if the point is in oncurve
12+
if p.type:
13+
# set the smooth to False and selecte the point
14+
p.smooth = False
15+
p.selected = True
16+
17+
# toggle smoothness
18+
g.naked().selection.toggleSmoothness()
19+
# update the glyph
20+
g.update()
21+
# set an undo
22+
g.performUndo()

0 commit comments

Comments
 (0)