Same width on every layer

Guys, I need to make sure that each glyphs on each layer has the same width (W) - any ideas how can I ensure this without checking each one manually? Thank you.

Selecting all in font view. If the width shows of in the info box in the lower left, all width are the same. Or sort by width in list mode.

No, but I mean, A has to be the same w in all layers but different than B… so I have to make sure selecting one by one and and move between layers…

Sorry, misunderstood this. This would be a good task for a script.

yeah huh, machinesss! I dont feel like doing that :frowning: I can imagine selecting and comparing on big beautiful loop, but I really don’t know how to start :slight_smile:

is there any shortcut to move between layers?

cmd+1 cmd+2 cmd+3…

Paste this into Macro panel and run (but before running, please replace {tab} with the actual tab, as this forum doesn’t show the tab). It will report the glyph name, layer name (includes non-master layers), and its width only when there’s a difference.

font = Glyphs.font
for glyph in font.glyphs:
{tab}for i in range(len(glyph.layers)):
{tab}{tab}if glyph.layers[i].width != glyph.layers[i-1].width:
{tab}{tab}{tab}print glyph.name, glyph.layers[i].name, glyph.layers[i].width

1 Like

oh, nice - will try it out, thank you. Didnt know whitespace is important here…

In Python, indenting with tab is not just a cosmetic organisation, but required.

How nice! tested. A has a different virtual width :slight_smile:

A Line 400.0
A Normal 294.0
Aacute Line 400.0
Aacute Normal 294.0
Abreve Line 400.0
Abreve Normal 294.0
Acircumflex Line 400.0
Acircumflex Normal 294.0
Adieresis Line 400.0
Adieresis Normal 294.0
Agrave Line 400.0
Agrave Normal 294.0
Atilde Line 400.0
Atilde Normal 294.0

Easily added in the Script menu :slight_smile:

Thanks,