Access to kerning classes



  • >>> f.kerning.asDict()
    >>> {('@MMK_L_f', '@MMK_R_o'): -55}
    

    How can I read-write the kerning classes via scripting? I couldn't find the way with robofab.
    I'd like to be able to know which glyphs are in the class and modify it.
    thanks.


  • admin

    The kerning keys can be either glyph names or group names.
    If they are group names (starting with an @) you can edit them in with the groups objects

    f = CurrentFont()
    f.groups["@MMK_L_f"]
    

    Its possible that this group isn't not in your groups but already hard coded into the features.
    (normally MM is adding those kerning groups also as font.groups items)

    note:
    RoboFont does not automatically convert font.groups to feature groups.
    Use this extension for converting and adding groups to the feature file: http://github.com/typemytype/RoboFontExtensions/tree/master/groups2Features

    good luck