update TemplateGlyphs

RoboFont Forums Help / General update TemplateGlyphs

This topic contains 3 replies, has 2 voices, and was last updated by  Thom 7 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5550

    Thom
    Participant

    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

    #5551

    Thom
    Participant

    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

    #5552

    frederik
    Keymaster

    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

    #5558

    Thom
    Participant

    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!

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

You must be logged in to reply to this topic.