I would like to set the value of all/ or selected kerning pairs (Kerning Window) to a particular number. I wouldn’t not like to achieve this with kerning groups, this is regarding legacy fonts that need new kerning, but I would like to keep the pairs for reference (thus setting them to a number like /zero or /one)
I don’t think there is such a script because I wouldn’t know what the purpose would be. But you could write such a script. Should be easy to step through the kerning dict.
myFont.kerning is a nested dict, that means the top level keys are the master IDs, then the keys for the left glyphs and groups, then the keys for the right glyphs and groups, and its final value is the kern value. You can get the available keys with the .keys() method. Take a look into the script Delete Small Kerning Pairs, specifically at the method DeleteSmallKerningPairsMain(), for an example of stepping through kerning data.
@mekkablue - I have been trying to crack this since you wrote me back with the dict. I simply can’t do it. Went as far as to iterate and extract all @MMK_L followed by all @MMK_R, but maybe I need some sort of /re to find the left glyphs and groups and their corresponding right glyphs and groups and extract them without the string “MMK_L” or “MMK_R” so as to be more useful.
I am thinking along these lines, though I have also tried other options like .split(), lists to tuples, enumerate() and ranges(value:value). I am sure this is due to lack of experience and probably can be done with each method, but still I wasn’t able to do it.
l1 = [ MMK_L_A, MMK_L_B ]
l2 = [ MMK_R_X, MMK_R_Y, MMK_R_Z]
result = [x+y for x in l1 for y in l2]