leftMetricsKey does not seem to work

currentLayer = Glyphs.font.selectedLayers[0]
print( currentLayer, 'left metrics key:', currentLayer.leftMetricsKey )

This always gives me None for the metrics key (leftMetricsKey or rightMetricsKey) even if there is one. Is this a bug or am I doing something wrong?

Your layer likely has a key designated as =XX, indicating that the key is assigned at the glyph level. You should access it using glyph.leftMetricsKey

However, if you assign a key as ==XX, then layer.leftMetricsKey will return your key.

1 Like

Thanks! Yes, that was the problem. I’ll simply try both the layer and the glyph then.