Kerning Macro, Fontlab API

Primary tabs

1 post / 0 new
Rachel Roberts's picture
Joined: 21 Feb 2007 - 12:23pm
Kerning Macro, Fontlab API

Hi all

I wrote this Robofab macro to copy kerning from one pair to others.

I am using Class kerning put I kern OAO and then use the macro to copy those values to AC, AG, AQ etc.

It speeds the process up and ensures I don't miss pairs

from import CurrentFont
f = CurrentFont()
kerning = f.kerning
if kerning[('A','O')]:
AO = kerning[('A','O')]
kerning[('A','C')] = kerning[('A','G')] = kerning[('A','Q')] = kerning[('A','OE')] = AO

if kerning[('O','A')]:
OA = kerning[('O','A')]
kerning[('D','A')] = kerning[('Q','A')] = OA

… …

Problem with this macro is it doesn't work with MM fonts. The value from one master is copied to the other.

The value for 'AO' could be different across masters but the macro copies the same value to both masters.

The Fontlab API KerningPair class says it's MM compatible but doesn't give any examples of how to use it.

Does anyone know how I could use FL's API to copy the value of kerning pairs to other pairs.