Export all instances to ufo

Hi, I try to sync the metrics keys in the exported UFOs. I have a “virtual” font which comes from `Font.copy()’ right at the very beginning. All other things I do to this copy work well (for example deleting a lot of glyphs) and only apply to the copy and not the real .glyphs file (exactly as I want it.

However, when I try to sync the layers in the virtual font, they a) are still not in sync in the exported UFO and b) my actual font suddenly shows some glyphs with the darker background in the font overview (meaning that they changed). This is kinda scary, I don’t want ANY changes to the original font. But I want the sync to happen to the virtual font.

for glyph in virtualFont.glyphs:
  for layer in glyph.layers:
    layer.syncMetrics()

When I make another copy of the already copied font like so:
virtualFontCopy = virtualFont.copy()
and call the code on this copy-copy, it at least leaves my original .glyphs file untouched. But the outcome still hast unsynced metrics keys in the interpolations.

Fixed it. Thanks

1 Like

Thank you!
Is there a way to access the fix tomorrow somehow, will it be in a new beta? Or a workaround to not have unsynced layers in the export?

Delete all background layers. But the changes are only cosmetic. It is not actually changing anything.

Edit: the Update is up.

Ah, I see. So the basic problem, that the exported UFOs got metrics keys that are out of sync when I open them in Glyphs will not be fixable?

I can flatten them in my script to the actual numbers. I just hoped it would be good to pass the information of the metrics keys on to the receiver. But I am not sure if they can see them anyway in RF

I dont understand

So I got a glyphs file with 3 Masters. There are metrics keys and they are in sync.
When I export the the 10 instances to UFO via a script and open the UFOs in Glyphs, the interpolated instances show the metrics keys, but they are red, out of sync, mainly off by one unit. This means, I have to sync all the metrics, and they effectively change in those glyphs then. I aim for the exported UFOs to have the proper values already. Apparently they get their values somehow. They show the metrics key and a LSB and RSB.

To make it even shorter: The same thing happens when I just “Generate Instances”. They are all out of sync as well.

I basically just want to sync them in the script before they are written to disk. But layer.syncMetrics() doesn’t have an effect.

I have looked into this a few times. The out of sync metric keys are due to rounding errors. I would just ignore them.

I would just apply the metrics sync instead of ignoring, because that will be done in any case anyway :slight_smile:

But in most cases the interpolated values are better than what is implied by the metrics keys.

I don’t think so. my koKai has 56 RSB and the letters that use it as a metrics key come out with 57. I want them to have the same as koKai RSB effectively. I got some glyphs that are symmetrical in the masters, using LSB: “=|koKai” RSB: “koKai”. In the interpolated instance now they got
LSB 56, RSB 57
but it should be
LSB 56, RSB 56

So if there is a rounding it seems to be not consistent. Or am I twisted?

I will just hit the sync metrics in the interpolated fonts for now. I just hoped there’s a way to not need to touch the export, since that is something you advocate for generally, I think :slight_smile: Thanks for the quick replies!

The RSB is not interpolated but the result of rounding the rightmost part of the shape and the rounding of the width. Having consistent RSB is only making the designer happy, nothing else :wink:

Or the client :wink:

But then you might just remove the metrics keys :wink:

I’ll show you later and explain the issue :slight_smile:

Smiley battle :blush:
:running_man::dash:

1 Like

:wink:

1 Like
     🤪
1 Like