fonttools/Scripts/RoboFabIntro/demo_InvertSelectedSegments.py
Erik van Blokland 617945dcf1 The scripts folder for FontLab as they shipped with Fab 1.1.1.
git-svn-id: http://svn.robofab.com/trunk@22 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-16 08:14:00 +00:00

16 lines
391 B
Python

#FLM: Invert Selection
"""Invert the selected segments in the current glyph"""
from robofab.world import CurrentGlyph
glyph = CurrentGlyph()
for contour in glyph.contours:
notSelected = []
for segment in contour.segments:
if not segment.selected:
notSelected.append(segment.index)
contour.selected = False
for index in notSelected:
contour[index].selected = True
glyph.update()