I have a very irregularly shaped, non-latin font, where I have to kern every letter pair. Let's say this font contains eleven letters. I have set the right margin of one letter – let's call it "A" – to 50 units. Then I kern that letter with the other ten letters, let's call them "B" to "K".
After kerning, I realize that of the ten letter pairs, eight ("B" to "I") have a kerning of -10 units, one ("J") has a kerning of +10, and one ("K") has no kerning (i.e. 0).
My font data now looks like this:
A 50
B -10
C -10
D -10
E -10
F -10
G -10
H -10
I -10
J +10
To simplify the kerning, I would like to change the right margin of letter "A" from 50 to 40 units (50 - 10 = 40), the kerning of the eight letters from -10 to 0 (-10 + 10 = 0), the kerning of "J" from 10 to 20 (10 + 10 = 20), and the kerning of "K" from 0 to 10 (0 + 10 = 10).
My font data should then look like this:
A 40
J +20
k +10
which results in the same spaces between pairs as before (e.g. 50 - 10 = 40 - 0).
Now, instead of going through the font and changing the margin and kerning manually, which is time consuming and error prone, I would like to do this programmatically.
While I was thinking about writing a Python script that will read the kerning information from the font file into arrays and then loop through the arrays and calculate the new values, I am wondering if there is font software that allows this manipulation out of the box, or maybe there are scripts available online that do this manipulation, and I could save me a couple of hours of inventing the wheel a second time.
Do you know of such solutions?