Kerning issue with specific glyphs

I can’t set up kerning between specific letter, for example for A X T Y , left kerning group is @LeftSharp and right kerning group is @RightSharp. Kerning between @LeftSharp and @RightSharp is -40.

But, when I set up kerning between YA to -100 with both locks open, this would show in the kerning window as: @ RSharp -100 A instead of Y -100 A. So all letters in @LeftSharp has a kerning of -100 with A which is not right, XA and TA should remain -40.

Why this happens?

You probably have both. It’s because you open one lock at a time. There’s currently no way to open both locks simultaneously.

Thanks for your reply! So how to set up specific kerning of YA without changing XA and TA?:sweat_smile:

For starters, I would assume X, T and Y have different right groups. Unless you have a very specific design that I cannot imagine right now, I do not think it makes sense to put such different glyphs in the same group. If not, open the X/T/Y’s group first, and only then A’s.

Or, here is a code snippet for the Macro Window that opens both locks simultaneously for the current kern pair:

tab = Font.currentTab
cursorPos = tab.layersCursor
if cursorPos >= 1:
	lLayer = tab.layers[cursorPos-1]
	rLayer = tab.layers[cursorPos]
	if lLayer.master == rLayer.master:
		master = lLayer.master
		lGlyph = lLayer.parent
		lGroup = lGlyph.rightKerningGroup
		rGlyph = rLayer.parent
		rGroup = rGlyph.leftKerningGroup
		kernValue = Font.kerningForPair(master.id, f"@MMK_L_{lGroup}", f"@MMK_R_{rGroup}")
		Font.setKerningForPair(master.id, lGlyph.name, rGlyph.name, kernValue)
		print(f"@{lGroup}-@{rGroup} → {lGlyph.name}-{rGlyph.name} ({kernValue})")

HTH

Thanks Rainer! Your reply is so detailed, I’ll reconsider the grouping and try your code.:grinning_face_with_smiling_eyes: