RemoveOverlap() error on glyph copy
djr last edited by gferreira
I am trying to perform remove overlap on a copy of a glyph, and get an error. Remove overlap works fine on normal glyphs, though.
Is this a bug, or is there a reason that parentless glyph copies can't remove overlap?
g = CurrentGlyph() gCopy = g.copy() print g, gCopy # to show these are not None g.removeOverlap() # works okay gCopy.removeOverlap()
Traceback (most recent call last): File "", line 5, in File "lib/fontObjects/robofabWrapper.pyc", line 2128, in removeOverlap File "lib/tools/removeOverlap.pyc", line 35, in removeOverlap File "lib/fontObjects/doodleBaseGlyph.pyc", line 141, in _get_segmentType AttributeError: 'NoneType' object has no attribute 'segmentType'
ah typo bug, thanks for posting
a temporarily workaround could be could be
g = CurrentGlyph() # create a copy layer and copy the glyph to that layer gCopy = g.copyToLayer("copyLayer") print g, gCopy # to show these are not None print gCopy.getParent() g.removeOverlap() # works okay gCopy.removeOverlap()
(edited your post a bit)
djr last edited by
thanks frederik! that workaround will certainly do for now...