removeOverlap() error on glyph copy

RoboFont Forums Bugs removeOverlap() error on glyph copy

This topic contains 2 replies, has 2 voices, and was last updated by  djr 8 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2651

    djr
    Participant

    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?

    For example:

    g = CurrentGlyph()
    gCopy = g.copy()
    print g, gCopy              #to show these are not None
    g.removeOverlap()        # works okay
    gCopy.removeOverlap()
    

    Output:

    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’

    Thanks!

    #2653

    frederik
    Keymaster

    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)

    #2663

    djr
    Participant

    thanks frederik! that workaround will certainly do for now…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.