Where is Console.app output?

I’m struggling with Python-related crashes and want to find out the cause (it’s especially setKerning functions that give me instant crashes). I set the ‘Use system console for output’ preference but I don’t see the outputs. Where in Console do I need to look?

Not sure about Console.app, but when running Glyphs from a Terminal you should be able to see the output.

Run the following line:

/Applications/Glyphs\ 3.app/Contents/MacOS/Glyphs\ 3

like so:

Thanks. I could see the Python output that way but couldn’t catch any error from the function.
I remember that Preference option working in the past, but not anymore I guess? And shouldn’t the option be rewritten if it uses Terminal instead of Console?

(Also I still do not like the fact that I now have to juggle around glyph names and IDs in G3 kerning, whereas everything was glyph names before.)

The trace back might be to late and the app is already gone in your case. Can you send me the script that I can see if I can improve the crashing behavior?

And I don’t remember changing the kerning API to not accept names. What functions do you use?

Here’s the script. You need to test with a file that have Greek and Cyrillic who belong to separate kerning groups. Line 164 causes the crash. Copy Kerning to Greek & Cyrillic.py.zip (3.4 KB)

In my case, a lot of kerning-related scripts were broken in G3, and the cause were all related to single glyphs being communicated in id instead of names. Maybe internally they have always been glyph id, but I never needed to see that before. Even GSFont.kerning output were all name-based before but id-based now, which I use often. Other functions are setKerning functions.

Actually, the ids even show up in regular UI. The screenshot is taken in the latest cutting edge version and new file.

When the IDs show up in the kerning window, that means it couldn’t find a glyph with that ID. I’ll have a look at the script.

Thanks. In the case of this screenshot, the kerning value was entered via standard keyboard shortcut.

This script is still not updated for the G3 behaviour for example, and worked in G2. Where single glyphs are used in kerning data, it’s exclusively exchanged in glyph names. I could read kerning data and applying the value to some other pairs without worrying about whether the pair members were glyph names or keys.

(By the way, I would suggest GSGlyph.left/rightKerningGroup to add MMK prefixes. It’s something I always need to add, and it makes more sense to me to include them than otherwise.)

There is a separate property that gives the full kerning class name (including the MM_K…): glyph.leftKerningGroupId() (fixed)

Thanks. That part is solved then.

I tried different kerning dictionaries and I noticed GSFont.kerningDictForDirection_() prints single glyphs in names, not IDs (that’s how I remember everything to be in G2 and I prefer it this way). Others print IDs on the other hand: .kerning, .kerningLTR(), kerningForDirection_()
@GeorgSeifert , what’s your thoughts on this? Do you want to unify or vary the formats? Can you keep at least one way to print glyph names?

(EDIT 1)
I also noticed that removeKerningForFontMasterID_LeftKey_RightKey_() only accepts glyph IDs (or group names) but doesn’t accept names. (removeKerningForPair() is the opposite)

(EDIT 2)
And to demonstrate another ID/name oddity, if I run the code below, the value in the kerning window shows the value in ID instead (and the method wouldn’t accept glyph ID as input).

A = Glyphs.font.glyphs["A"].name
Glyphs.font.setKerningForPair(m.id, A,A,-20)

What is the argument for RTL kerning in Glyphs.font.kerningDictForDirection_()? I have tried 0–255 but none of them seems to be it. 0 and 1 seem to be identical, and the rest is a miss.
(I don’t want to use kerningRTL since it reports glyph IDs)

The real issue is that I have a Latin-Arabic file whose kerning data is all mixed up in LTR table (made in G2) and want to make it G3-compatible. Is there already an easy ready-made solution for that?

RTL should be 2. See GSWritingDirection. In Python, you can use the constants defined in the Python docs:

# => 2

Thanks. It’s strange, nothing is reported even though I do have pairs.

Hm, works for me. Could you send your file to the support email address?

Ah never mind, it works. (maybe not right after I run a script)