Clearing linked metrics


#1

When I update metrics numerically through scripting, I would like also to wipe out any earlier instances where I might’ve manually typed out a linked metric, eg. “=O”. How can I remove the linked metrics?


#2

Glyphs and layers have property right and leftMetricsKey: https://docu.glyphsapp.com/#leftMetricsKey. You can set it to None to remove its previous value.


#3

This is weird. When I set it to “None” it shows up as “==None” in the UI. When I set it to None without quotes, it seems to remember what it was from before. I would like to clear the metricsKeys and stick with a pure integer.


#4

None without quotes.


#5

None does not seem to work — it reverts back to the original value of “=O”. I will post a video when I have a chance.


#6

Then you need to set the metrics key on the glyph (the parent of the layer).


#7

I was making superscript, numerators, etc using RMX scaler
They got the metrics linked with the basic numbers one, two, three, etc
I don’t want to keep those metrics, because the shapes are smaller and are in different positions. What is the opposite of update metrics? How do I make it ignore the linked metrics?
Thanks


#8

I suggest you set up one set of small figures (e.g. .dnom) with the proper metrics, without metric keys (simply delete them). Then, for the others (.sups, .numr, .sinf in this example), you place .dnom components in them, shift them vertically to your liking, but make sure they are auto-aligned. That way .sups, .numr and .sinf inherit the metrics of .dnom.


#9

Or was you question how to remove the metrics keys?


#10

Yes, I would like to remove the linked metrics keys in bulk, keeping the spacing.


#11

Ok, I found a script to delete metric keys


#12

You can also select all glyphs in Font view, click in the LSB, press space and delete it straight away, and do the same in RSB.