Through some sequence of update corruption or user error, I have many glyphs that have their sidebearings set to “==n” (where n is some other glyph). This is the proper setting when you want to borrow sidebearings from another glyph for this master only, but somehow I have that happening in a bunch of sidebearings where every master borrows those settings. In other words, light and regular /copyright LSBs will be O, but bold will be ==O. Or light and bold /rightarrow LSBs will be =|leftarrow, but reg will be ==|leftarrow.
What’s the easiest way to clean this stuff up–to remove extraneous equals signs when all masters’ sidebearings make the same reference?
Scripting, as far as I now. This deletes layer-specific keys of selected glyph. It does not report which glyphs had those, but can modify that way if you want:
for layer in Glyphs.font.selectedLayers:
g = layer.parent
for l in g.layers:
if l.leftMetricsKeyUI()[:2] == "==":
if l.widthMetricsKeyUI()[:2] == "==":
if l.rightMetricsKeyUI()[:2] == "==":
Yes, (once I again capitalized the “l”) that seemed to work. Thanks! I appreciate the help.
Would it be far more complicated to build in a test that checked whether all masters had the same key setting before removing the equals signs? I can imagine that being a more broadly useful script–kind of akin to the “Clean Up Kerning” function that determines which kerning settings are extraneous and deletes those that are.