Remove Glyph as alt-delete (robofab?)



  • This could be a robofab specific question but as it's linked to Robofont I put it here.

    When removing a glyph in Robofont via python with f.removeGlyph(g) the glyph slot goes away too (as selecting and alt-delete in the font window).

    If I do the same outside Robofont using robofab, when I open the .ufo the grey slots are there.

    Is there a way of removing them too?

    Thanks for your help.


  • admin

    The gray template glyph cells are being build up for new UFOs from the character set in the preferences and for existing UFOs the font lib key public.glyphOrder if the lib key is existing.

    You can alter the data in the lib easily with interaction with the UI by:

    font  = CurrentFont()
    
    glyphOrder = font.glyphOrder
    glyphOrder.remove("a") # test before removing a name if its in the list
    font.glyphOrder = glyphOrder
    
    # done
    

    This is sort of what happens when you alt-delete a glyph in the font overview.

    good luck