# copies all kerning from sourceMaster to targetMasters
sourceMaster = Font.masters[0]
targetMasters = [ Font.masters[1] ]
# delete current kerning from targetMasters
for master in targetMasters:
Font.kerning[ master.id ] = {}
for leftKey, rightKeys in Font.kerning[ sourceMaster.id ].items():
for rightKey, value in rightKeys.items():
# if no group, get glyph name
if '@MMK' not in leftKey:
leftKey = Font.glyphForId_(leftKey).name
if '@MMK' not in rightKey:
rightKey = Font.glyphForId_(rightKey).name
for targetMaster in targetMasters:
Font.setKerningForPair( targetMaster.id, leftKey, rightKey, value)
1 Like