Best way to bulk transform or change metrics in glyphs with components?

I’ve finished a font design and now want to transform the metrics, either by subtracting or adding a value (relative), or using the ‘Change Metrics by Percentage script’ but there’s a problem sometimes when dealing with glyphs that contain components.

If I select all glyphs and apply metric transformations, sometimes the transformations double up, i.e. if glyph ‘stem’ is a component in glyph ‘d’, the stem will move out of place since it will move once in the original ‘stem’ glyph and again in the ‘d’ glyph. When the glyphs are made via anchors, the metrics are ‘smart’ and transformations don’t double up.

What’s an easier solution here?

For now I’m just finding all the glyphs that have components and manually fixing them – is there a way to create a filter that shows all glyphs that exist as components in other glyphs?

Separate, but related:

What would also be good is to be able to transform only the paths in a glyph excluding the components, that way I can move the glyph that is a component (i.e. ‘stem’), then in the glyph that contains that component (‘d’), I can shift only the part that is a path. Otherwise transformations double up again.

If the componented glyphs have the “automatic alignment”, the metrics-transformation will not change them twice

you can use “custom filters” to sort the glyphs:

I have one filter to show every glyph with handdrwan paths:

name orginale predicate layer0.pathCount > 0

one for glyphs made out of components only:

name compo predicate layer0.componentCount > 0

and one for glyphs — like the ł — with vector AND componets:

<dict>
	<key>name</key>
	<string>compo + orginal</string>
	<key>predicate</key>
	<string>layer0.componentCount &gt; 0 AND layer0.pathCount &gt; 0</string>
</dict>

I would mark all glyphs that you use as parts of other glyphs (e.g. stem) with a e.g. red (some color that you didn’t use already) label.
You don’t need to include glyphs that are used to build accented letters as they will fix themselves.

Then you set up a list filter to show all non red glyphs and to all of them you can apply you metric changes.

Thanks for your responses, I had set up those kinds of filters too! I will just be marking them from now on.

I use this too for complex component-builds. Its the best way.

Not sure if there’s been any other discussion about this, but I’ve had to use ‘transform’ to scale a whole Thai font. Components are used alongside paths in many glyphs, but the transform operation is scaling the components twice (and sometimes three times if they’re components built of components), and I’m having to go through all composites in all masters and manually set each component to 100% size. What’s the recommended way to do this sort of thing?

Did you try to use the Scale to UPM button in Font Info > Font? Does it give a different result?

I’m only changing the Thai size, not the Latin.

I’m finding it hard to imagine a situation in which scaling just the live outlines would not be enough. When would it be useful to scale components within glyphs, when their outlines are already being scaled? It’s very time consuming to undo.

Do you mix components and paths in glyphs? If not (i.e., only paths-only or compounds, which is what I recommend), you could easily find all path-only glyphs with a smart filter, and scale those. Then the only thing you would still have to worry about are the positions of additional anchors in compounds

I was just asking if the font wide scaling would give different results. I’ll have a look. But for now, what Rainer said.

Have you tried many non-Latins? Glyphs with paths and components are pretty indispensible in the ones I deal with.

Lol, that’s not trivial.

I don’t know, I didn’t want to try alternatives that clearly won’t help me meet my deadline. Also the different masters require different scaling values.

I changed it that it will not scale components that point to glyphs that are selected and scaled.

1 Like

Exactly the thing I was hoping for! (For now I’ve had to decompose everything totally, scale and move as necessary, check/reposition anchors and then reimplement all the components.)

Related question: does the transform/scale operation also scale kerning values when multiple glyphs are selected? (haven’t had time to check yet.) If not, is there a way to scale kerning?

(These may sound like rare-case scenarios, but when developing UI versions of existing fonts, scaling subsets of glyphs in different ways is an important step. It would also be very helpful to have the option for transform/scale to operate relative not just to baseline/x-height etc but to top/bottom of glyph bbox and/or arbitrary coordinates.)

1 Like

The transform filter has the option to scale from different origins.

I think you misread my post:

The only options I get are:

1 Like

That would be the job of a (fairly simple) plugin.

Edit: I just uploaded a new TextMate bundle in the Python for Glyphs repository that contains a transform() snippet. Perhaps that can come in handy for that case.