'auto' sidebearings?

Is there any information on how the ‘auto’ sidebearings are supposed to work? How can I use or set them?

I just tried entering ‘auto’ as sidebearings of my softhyphen (which contains one component, the hyphen) and it was rejected. I tried dis- and re-enabling automatic alignment but it did not do the trick.

As far as I know: when all components of one glyph have “Automatic Aligment” enabled, the sidebearings will be “auto” automatically.

Doesn’t work for the softhyphen. Bug?

The auto spacing works only for letters.

Is it possible to access the information auto (as written in LSB / RSB / Width of a Layer) via python?

Or is it basically the same as asking for all components to be set to automatic-alignment?

I’d like to extract this certain information as simply as possible.

There are layer.leftMetricsKeyIsInSync(), layer.widthMetricsKeyIsInSync() and layer.rightMetricsKeyIsInSync() they return

  • Out Of Sync = 0
  • In Sync = 1
  • Invalid = 2

Ah thank you. Kind of what I am after. But it returns 1 as well for glyphs that have no metrics key (e.g. A which has just numbers in the LSB, RSB and width)

Technically they are not out of sync, so that is correct. You also need to check for the existence of a metric key on glyph or layer level.

Ah, sure. Oh, but I see, my case: Aacute has no metrics key, but written auto(12) in the LMK.
glyph.leftMetricsKey returns None, and layer.leftMetricsKeyIsInSync() returns 1 as well.

Unfortunately the same results come with the A, which has plain values. So I still cannot get the difference (A <—> Aacute, while latter is auto())

There is another property layer.hasAlignedWidth().

That’s it. Thanks!

Edit: Just curious: why is this property not findable in help() or dir() of layer?

It is not? It is:

Not in the macro Window.

Huh?

Remember that all the names are case-sensitive. To be on the safe side, make the if statement something like if searchstring.lower() in functionname.lower(): .

I was going the super old-shool-way print dir(Glyphs.font.selectedLayers[0]) and then searching the output. This way one cannot find it. But shouldn’t it be possible as well? Cuz basically I call it on an objective-c class NSKVONotifying_GSLayer.

I was not aware, that dir(GSLayer) is possible on its own. Now I am :slight_smile: