Propagate component to all selected glyphs & masters

I’m trying to propagate components to all masters and layers in the selection, and while I can get the component into all the selected glyphs, or into all the masters of a selected glyph, I can’t get it to all masters of all the selected glyphs.

I feel like I’m missing something really obvious.

All selected layers:

for layer in font.selectedLayers:

All masters of selected glyph:

for layer in glyph.layers:

“source” refers to user input variable that identifies the glyph to use as a component by name.


I think that you need this Mekka script.

This isn’t quite what I had in mind, but maybe I’ll be able to scavenge some of that script into my own.

Thanks for the suggestion :slight_smile:

for layer in font.selectedLayers:
    glyph = layer.parent
    for glyphLayer in glyph.layers:

I was going to say I tried it and it didn’t work, but I was using layer.components, instead of glyphLayer.components… like I mentioned, something stupidly obvious. :man_facepalming:

Thanks Georg