Suggestions? how to erase current glyph's kerning?

Like in the topic. How can I do it from macro-script level?

font = Glyphs.font
currTab = font.currentTab

leftLetter = currTab.text[currTab.textCursor-1]
rightLetter = currTab.text[currTab.textCursor]
leftLetter = Glyphs.niceGlyphName(leftLetter)
rightLetter = Glyphs.niceGlyphName(rightLetter)

for glyph in font.glyphs:
	if == leftLetter:
		leftLetter = glyph

	if == rightLetter:
		rightLetter = glyph
print rightLetter

this doesn’t work :frowning:

I don’t understand why you iterate through all glyphs. This works:

font = Glyphs.font
currTab = font.currentTab

leftChar = currTab.text[currTab.textCursor-1]
rightChar = currTab.text[currTab.textCursor]
leftGlyphName = Glyphs.niceGlyphName(leftChar)
rightGlyphName = Glyphs.niceGlyphName(rightChar)


I tried to do it like you showed and it didn’t work (that’s why I tried to iterate through all glyphs: I thought that maybe there is solution). Maybe there is problem with my GlyphsApp. I will reinstall glyphsapp

I just figured out that removeKerningForPair doesn’t work with one particular .glyph file. Still don’t know why

Can you send me the .glyphs file and the script you used?


That script only removes kerning between glyphs, not between classes. Instead of the glyph name, you need to remove the kerning with the .leftKerningGroup and rightKerningGroup:

font = Glyphs.font
currTab = font.currentTab
cursor = currTab.graphicView().cachedSelectionRange().location # there will be a wrapper for this in the next version

leftLayer = currTab.layers[cursor - 1] 
rightLayer = currTab.layers[cursor ] 
leftGlyphName =
rightGlyphName =

leftGroup = leftLayer.parent.rightKerningGroupId()
rightGroup = rightLayer.parent.leftKerningGroupId()

font.removeKerningForPair(, leftGlyphName, rightGlyphName)

font.removeKerningForPair(, leftGroup , rightGroup)

font.removeKerningForPair(, leftGroup, rightGlyphName)

font.removeKerningForPair(, leftGlyphName, rightGroup)