Metrics key link to another layer?

With a font that has two masters, one for contrast and one for no contrast, I find myself constantly updating sidebearings twice, since both masters (of each weight) will almost always have the same sidebearings.

Is there a way to link the sidebearing to another layer / master of the same glyph?

If not, would this be a viable feature for implementation? Sidebearings could use a special notation to reference the master or layer, like =#Regular (or =#Regular-20 etc.) to link to the metric of this glyph’s Regular layer. The same feature would also be viable to link bracket layers or smart component layers that you now also have to manually go tweaking.

That is an interesting idea. Did you try the “Link Metrics with Master” parameter?

Ah, I didn’t even remember that one, but now recall it from the color font tutorial.

For this particular case it’s not applicable though. In fact I have a file with 6 master, 3 weights with no contrast and 3 weights with contrast, so I’d essentially want to link the second three for almost all (and not necessarily all, since in some glyphs the different contrast might call for different, but related sidebearing, alas my example with the #Master+xx).

I thought about it, but would you think this could be easily done with a plugin, I somehow don’t see how? Altering the sidebearing links on every draw updates seems excessive, and also how would I overwrite my “custom” syntax into actual sidebearings and still have them in the UI, or is there a plugin type that could be more suitable for this?

Or the other way around, would this be something you’d consider adding and how difficult would that be? I suppose it just requires an additional match type for the sidebearing parser and looking up the sidebearing from the layer, or is there something more complex involved?

The metrics keys are not updated live. There are some problems with undo I have to resolve.

One could write a plugin that calculates the metrics keys but adding the new format would break the build in function.

Inquiring about this again. I think being able to link to a glyph’s other layer’s metrics would be super useful. Point in case:

  • Typeface with various weights and for each weight an open inline style where the normal and the inline masters should have equal metrics
  • Typeface with optical weights, where for many glyphs I could use something like =1.25*#Regular for caption or =0.8*#Regular for display with Regular being the master in the middle

:slight_smile:

The width can be linked with an Link Metrics With Master custom parameter on the master. That should cover the first use case.

I have a look at the second.

1 Like

Works like a charm, thanks for that feature.