Update TemplateGlyphs



  • Hi, I want to have more controle over the TemplateGlyphs. So I making my own tool. It change the public.glyphOrder. But it doesn't show my new TemplateGlyphs until the font is closed and reopened. f.update() doesn't do the trick.
    Who can help?

    Thank Thom



  • No really, it remove also the existing templateGlyphs. But:

    glyphOrder = []
    for glyph in f.lib['public.glyphOrder']:
    	glyphOrder.append(glyph)
    for glyph in myListOfGlyphs:
    	glyphOrder.append(glyph)
    f.glyphOrder = glyphOrder
    

    Thanks Fredrik!


  • admin

    This must work:

    f = CurrentFont()
    
    glyphOrder = f.glyphOrder
    
    glyphOrder.append("addedGlyph")
    
    f.glyphOrder = glyphOrder 
    

    The glyph name to unicode are extracted from the fontTools agl.py
    see http://sourceforge.net/p/fonttools/code/HEAD/tree/trunk/Lib/fontTools/agl.py

    you can add custom unicode by adding a unicode value to the glyph name:
    see http://doc.robofont.com/documentation/workspace/font-collection/adding-and-deleting-glyphs/

    so add a glyph Kacute|1E30

    good luck



  • Extra question about the TemplateGlyphs:

    If I add for example Kacute to the font, it will not add automatic the unicode value to the glyph. Can I changed this?

    When does RoboFont show the preview font in the TemplateGlyphs? Name, unicode, combination?
    I tested around to get the Kacute as a TemplateGlyph [used my own font as previewFont, it contains a Kacute + unicode], no succes…

    Thanks again