Copy / Swap to Layer deletes local guides



  • Is this a preference that can be toggled some how or is this a bug? When flipping the contents of a layer around, all guides are deleted.


  • admin

    hi Dave, thanks for reporting it. I think it’s a bug, and I’ve created an issue for it.

    in the meantime, here’s a workaround so you can flip layers and keep guides:

    glyph = CurrentGlyph()
    
    layer1 = 'foreground'
    layer2 = 'background'
    
    guides1 = glyph.getLayer(layer1).guidelines
    guides2 = glyph.getLayer(layer2).guidelines
    
    glyph.flipLayers(layer1, layer2)
    
    for guide in guides2:
        glyph.getLayer(layer1).appendGuideline((guide.x, guide.y), guide.angle, color=guide.color)
    
    for guide in guides1:
        glyph.getLayer(layer2).appendGuideline((guide.x, guide.y), guide.angle, color=guide.color)
    


  • Hey Gustavo,

    Thanks for that, works great.

    D


Log in to reply
 

Looks like your connection to RoboFont ● Forum was lost, please wait while we try to reconnect.