contour.index raises AttributeError

RoboFont Forums Help / General contour.index raises AttributeError

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

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

    joanca
    Participant

    I’m trying to delete a contour (well, some of them) and I get an AttributeError where (I think) shouldn’t as it’s robofab’s (and works in FL this way).

    g = CurrentGlyph()
    for con in g:
        print g.index
    

    Thanks you!

    #3984

    frederik
    Keymaster

    Why do you need the index of the contour?

    use:

    glyph = CurrentGlyph()
    ## dont remove and iterate over the same glyph object
    ## so create a temp list of contours
    contoursToRemove = list(glyph)
    
    for contour in contoursToRemove:
        glyph.removeContour(contour)
    
    #3986

    joanca
    Participant

    Well, in this case I don’t need it (thought shouldn’t it work?)
    I didn’t find glyph.removeCountour() in robofab’s documentation : [

    Thanks!

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

You must be logged in to reply to this topic.