Auto kerning being reported differently between Glyphs 1 and Glyphs 2

I have a script to print which glyphs have Auto kerning, but now it doesn’t work in Glyphs 2, this is a simplified snippet:

Selecting a glyph with Auto metrics in the LSB/RSB in Glyphs 1 returns: whereas in Glyphs 2: What's happened? And how do I make this work again such that it will report whether or not a glyph has automatically set metrics.

Original script:

There is thisGlyph.leftMetricsKey and thisLayer.leftMetricsKey() and the setter method thisLayer.setLeftMetricsKey_(“n”).

The difference between glyph-level keys and layer-level keys is stricter (and clearer) in G2. If you set a layer key, you create an exception for that layer, and it will be indicated with a double equal sign. E.g.:

thisGlyph.leftMetricsKey = "p"
print thisGlyph.leftMetricsKey
print thisLayer.leftMetricsKey()

will output:


I think you mean the auto-spacing. I changed that so that you can figure out if the Layer or the glyph has a metrics key (like ‘=n+10’).

To get the result from before, use Layer.leftMetricsKeyUI(). If all you need to know is if the layer is auto aligned, use Layer.hasAlignedWidth()

Thank you for your help!