Copy sidebearings

Is it possible to copy the sidebearings from one glyph to another? In Fontlab I used “paste special” to do that …

One step further: is there a way to copy all sidebearings and all kerning information from one glyphs-file to another?

In the sidebearing field, instead of a number value, you enter the name of the glyph you want to copy the sidebearing from. Every time you choose Update Metrics from the Layers menu, the sidebearings will be synchronized. Yes. There is a script for that: https://github.com/mekkablue/Glyphs-Scripts Look for Metrics > Copy sidebearings. You will need Vanilla installed. The readme file explains how.

And as for the kerning question (although I don’t think it is a good idea to copy kerning between fonts), you may want to look at this thread.

Thanks a lot, mekkablue! I already use the synchronized sidebearings extensively, it’s a great feature.

Nevertheless sometimes it would be nice to just copy / paste them.

I want to copy all the metrics and kerning information from the upright to the italic version of my font. As the sidebearings are so nicely slanted in glyphs, i guess that makes sense?

You can do that with the script. Just select the respective letters and run the script. Do you need help installing it?

The method you seem to describe (select source glyphs, copy the side bearing into the clipboard, select target glyphs, paste from clipboard) is a little tricky. What should happen if the number of selected glyphs is not the same? Or the order? Etc. The script has a different, and IMO more efficient approach: It looks for the glyphs with the same name and enters the same values into the LSB/RSB fields.

I assume you have them in two different files? Take the script for the sidebearings and for the kerning, use the copy/paste method described in the thread I mentioned above.
Is ist very complicated? That Vanilla stuff looks a bit scary ... until now i managed to get along without Python and the Terminal ;-)

You can copy the kerning from the kerning panel.

Under the Metrics folder I can’t find “Copy sidebearings” I see “Steal sidebearings” is this the one you refer to?

Now it is called Steal Sidebearings, right.

Thanks very much. Regards.

@mekkablue I was trying to use the Steal Sidebearings script, but it shows that it’s been deleted. I’m not super hip to the whole scripting thing so it’s possible I’m doing it wrong.

Maybe there’s another way to do what I want now. I have 4 masters and I need the sidebearings on master 2 to link with master 4. Setting the custom parameter Link Metrics with Master doesn’t do it. Maybe metrics doesn’t cover sidebearings?

Thanks!

Metrics means width, and hence, indirectly sidebearings. Linking metrics with a master links all masters though.

The script only works with selected glyphs.

Ok. I used the parameter “Link Metrics with Master” and for the value it defaults to 1 and I changed that to both the corresponding number in the master list and then tried with the actual master name. It didn’t seem to do anything at all. I even pulled out the 2 masters I wanted to share metrics into their own Glyphs document and used “Link Metrics with First Master” parameter and nothing changed.

I was able to duplicate the kerning by copying and pasting so that’s all good, but the sidebearings are what needs to change. As I mentioned the link from the beginning of this thread to GitHub shows that the Steal Sidebearings script was deleted so I was unable to use that.

Here’s what I’m trying to do and maybe there’s a better way than what I’m doing. I’m working on a display typeface with 4 masters set up like this:

  1. Clean upright version
  2. Clean slanted version
  3. Distressed upright version
  4. Distressed slanted version

The upright masters are perfect because I started with the clean upright, duplicated and then replaced the glyphs by copying and pasting the distressed artwork. All metrics stayed intact for the most part.

Then I duplicated the distressed version to create the distressed slant master. Got that all kerned up and nice. I then tried to repeat that process by duplicating the clean master and running the same transformations to get the slant thinking I could easily sync up all the kerning and metrics with the distressed slant master.

So really I need Master 1 and 3 to share metrics and Master 2 and 4 to share metrics. I think I’m repeating myself now so I’m sorry about that.

One correction: Link Metrics With Master can selectively link masters to other masters. It takes the name of the other master as value.

So, in the third master gets a parameter Link Metrics With Master with the name of the first master as value. Same for the fourth, but with the name of the second master as value.

The widths will then stay in sync.

The Steal Sidebearings script has been reworked and renamed to Steal Metrics.

I see that now. The width is synced up, but the character is shifted inside the box. So in the corrected master (master 4) the /A/ width is 467 with LSB as -30 and RSB as 30. However, in the master that is linking metrics to correct master (master 2) the /A/ has a width of 467 so that synced, but the LSB is -48 and RSB is 47. Shouldn’t it grab the -30 and 30 from Master 4 or is that what I need the script for?

I swear I’m not trying to make this difficult but I often do that. :smile:

1 Like

I used the script. Worked like a charm. Everything is super fantastic and the script is a work of art. Thanks for the help! Sorry again for overcomplicating it.

Yes. The parameters must sync the widths and of course they are not supposed to sync the sidebearings, because that would break layered and color fonts.

Makes sense. Thanks again!

1 Like

Hi @mekkablue!

Here is Markus from Munich :wink:
I used your nice script “Steal sidebearings” and it works! But now it runs continuously and I’m not able to do individual corrections in each weight. The script copys my corrections to all other weights automatically. Is it possible to keep the result of the script and stop it?

Best,
Markus

Hmmm weird. What do you mean. By “runs continuously“? Should be finished after a few seconds.