RTL Kerning Conversion Glyphs 2 to 3

In July, we had a topic about the missing values in kerning while converting files from Glyphs 2 to and the use of the script “Convert RTL Kerning from Glyphs 2 to 3”

Continuing the discussion from Organization of Classes:

You promised to take a look at this, but it seems like nothing happened until now. Can we expect a solution some day?

Glyphs 2

After using the script in Glyphs 3, the right kerning is gone.

The script currently misses kern pairs that start with non-RTL punctuation. I’ll see what I can do.

The kerning is not lost, it is just wrongly assigned to LTR. Can be difficult to sort out (and possibly there is no good solution) if LTR and RTL is mixed in kerning groups.

But its only an issue on the right side. The left side work. Wouldn’t it be possible to mark every pair, that contains at least one RTL glyph as a RTL kern pair?

The opposite will never occur, i think.

So, finally fixed the script. It does not matter if the first or the second half of the kern pair is an RTL glyph.

One warning: when converting from G2 to G3 kerning, the script assumes that kerning groups used for RTL kerning are also named after RTL glyphs, e.g. @dalet-hb.

That’s nice.

Unfortunately, I am still using production names for glyph names and kerning group names ( because there seems to be no easy way to convert them).

Is there any way to ask for these unicode names?

this is the interesting part, right?

def glyphNameIsRTL(glyphName, key2Scripts):
	glyphName = glyphName.replace("@","")
	if glyphName in key2Scripts.keys():
		if GSGlyphsInfo.isRTLScript_(key2Scripts[glyphName]):
			return True
	return False

I can’t find “GSGlyphsInfo.isRTLScript_”. Is it an undocumented function or property?

I don’t understand the reasoning. You can convert production names into nice names. And even if not, why would it force you to use production names in the design process?

Yes, you may need to work on this method in your own fork and adapt it to your custom workflow. I have not tested it, but it should work with production names as well, as long as they are listed in GlyphData.

It is an unwrapped ObjC method. In a Python context, you would only find it with dir() or with Method Reporter.

I just gave it a try, but all kerning is only LTR and the script does not change anything. No errors. Did I forget anything in the conversion process?

:one: Convert RTL kerning from Glyphs 2 → 3:

:capital_abcd: Master: Regular

:two: Flipping kerning groups for RTL glyphs:

:white_check_mark: Done.

Glyphs 2 RTL Mode:

Glyphs 3 in LTR Mode:

but in RTL: