Adjusting sidebearings

Is there a way to automatically center selected glyphs on their advance widths, so that their left and right sidebearings are equal?

And is there a way to adjust sidebearings and/or advance widths of multiple glyphs by percentages, instead of units?

Thanks!

Two ways:

  1. There are scripts for that in both mine and Georg’s GitHub repositories.

  2. Usually it makes more sense to add/substract. But I assume you know what you are doing and you know that a sidebearing can be negative. Having said that, type this in the Macro window:

for thisGlyph in Glyphs.font.selectedLayers:
thisGlyph.RSB *= 1.2

There is a tab at the beginning of the 2nd line. When you run it, it will multiply all the RSB of all selected Glyphs by 1.2. Replace RSB by LSB, or adjust the number value to your liking.

Thanks for the speedy reply, Rainer.

Why does it make more sense to add/subtract? When I tighten the spacing in a face, I find that glyphs with small or non-existent sidebearings, like V, Y, and X, should generally be tightened less than glyphs with wide sidebearings. Glyphs with negative sidebearings are relatively rare in upright roman fonts, and can be readjusted by hand afterward. Of course, itals are a different story.

Anyway, it would be wonderful if Filter > Transformations > Metrics > Relative accepted percentages as well as absolute values. I use this feature in FL all the time.

And I think being able to center a glyph in its advance width would also be a great addition. Again, I personally find this very helpful in FL.

Many thanks for your time and script.

See, that is what I use metric keys for, i.e., stuff like “=o+10” or “=|n” in the sidebearings. What I do is, I readjust my key glyphs, usually n, o, v, and depending on the design, a few others, then I update metrics (ctrl-cmd-M) on all glyphs. This method takes the complexity of the relationships between sidebearings into account.

Percentage changes, in my experience at least, have not worked so well, especially when there were negative SBs involved, which happens with diagonals. You want to, say tighten by 20%, but the diagonals will suddenly have more space, because -20% on an SB of -30 will result in -24, which is more space, not less, thus the opposite of what you may have wanted to achieve. Simple additions/subtractions by fixed values are usually the lesser evil.

1 Like

These are terrific tips, Rainer. Thanks!

I see ‘center glyph’ under spacing in your mekkablue scripts - I select it and nothing happens to the glyphs I’ve selected. Would love to be able to do this on a selected outline or composite in the glyphs window. Of course it’s good to be able to do in the font window but I like to be able to do it while drawing :slight_smile:

Can you check the Macro window if there is any error message?

The complete glyph gets centered. It works for me as expected in 3.0.5 (3120). What exactly are you doing?

I just added the centering of a selection only.

Hi @SteveMatteson, the latest version of the script works as expected in the latest version of Glyphs (3.0.5, build 3120) for me, both in Font and Edit view.

  • Uninstall and reinstall the mekkablue scripts in Plugin Manager to make sure you have the latest scripts.
  • Watch the Macro window for any error messages.
  • Make sure the glyphs are not auto-aligned.