Lock sidebearings and calculate based on middle line

Hello,

is there a script or something, that would allow to lock the sidebearings? If I change the width of the glyph itself, I wouldn’t have to adjust the sidebearings again. The way I imagine it, it would be unlocked by default and if you click on a little lock, like the one for kerning exceptions, the sidebearings would always snap to the entered value. Maybe after you exit the edit mode, to not interrupt the flow.

Also, is there a way to calculate the distance between the sidebearings and the glyph based not on the outmost point, but on the (customizable?) middle line? Like in good old FontLab. Useful for /j and the like. Currently I set the left sidebearing to =i minus the distance between the hook and the stem. Of course I have to recalculate every time I change the hook, with the middle line it would stay the same regardless.

1 Like

You can set the SB to equals and a number rather than just the number, eg “=25”. Then every time you update metrics, the SBs are reset to that number.

And for the j, I would not make it dependent on another SB in the first place. That way you don’t need to recalculate anything when you change the hook.

Though I can see the motivation for locking sidebearings to a measurement line, in this particular case you can set the right-hand sidebearing and advance width of the /j/ to match the /i/. That way changing the tail of /j/ won’t affect the sidebearings and the glyph will always match the /i/ in width.

1 Like

But the advance width can’t be synced? Or do you mean that remembering one advance width is easier than recalculating the sidebearing?

That works perfectly, thanks!

But then I would lose the usefulness of metric keys. It’s not only the /j.

Yes it can be synced. Just add a metrics key to the width field.

1 Like

Ah, my bad, I’ve tried it on a glyph with both SB synced and got an error message that I didn’t really read :smiley: