Building accents?

RoboFont Forums Features Building accents?

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  frederik 9 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #995

    joanca
    Participant

    Hi,
    This “Building Accents” code (almost 100% taken from the RFab site) is not working and I can’t figure out why. It runs apparently fine but the glyphs are not updated, they keep empty.
    Any thought? Am I missing something?

    Thanks,

    Joancarles
    ————————————————————

    # from robofab.world import CurrentFont
    from robofab.tools.toolsAll import readGlyphConstructions
    # from random import randint
    
    f = CurrentFont()
    
    import string
    
    theList = [
        'ecaron',
        'acircumflex'
        ]
    
    con = readGlyphConstructions()
    theList.sort()
    
    def accentify(f, preflight=False):
        print 'start accentification', f.info.fullName
        slots = con.keys()
        slots.sort()
        for k in theList:
            if k[-3:] in [".sc"]:
                isSpecial = True
                tag = k[-3:]
                name = k[:-3]
            else:
                isSpecial = False
                tag = ""
                name = k
            parts = con.get(name, None)
            if parts is None:
                print k, "not defined?"
                continue
            base = parts[0]
            accents = parts[1:]
            f.generateGlyph(k, preflight=preflight)
            # f[k].mark = 100 + randint(-20, 20)
            f[k].autoUnicodes()
            f[k].update()
        f.update()
    
    accentify(f)
    print 'done'

    ————————————————————

    [I just prettified your code example]

    #999

    frederik
    Keymaster

    the font overview doesn’t get updated, this will be solved in the next version…..

    side note:

    ## glyph.mark takes a tuple of 4 
    r = 1
    g = 0
    b = 0
    a = 1
    glyph.mark = (r, g, b, a)
    #1000

    frederik
    Keymaster

    and its maybe better to use font.compile since you already know the base glyph and accents

    ## in your example
    ## replace f.generateGlyph(k, preflight=preflight) by
    
    f.compileGlyph(k, baseName=base+tag, 
                             accentNames=accents, 
                             preflight=preflight)
    #1079

    joanca
    Participant

    Apart from the refresh of the font Overview, the anchors are ignored when placing the accents. It just appends the components ignoring the anchors placement.
    Can you confirm this?

    #1080

    frederik
    Keymaster

    its idd not working in the current build
    this will be working in the next update, this is scheduled soon :)

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

You must be logged in to reply to this topic.