Copy stroke attribute across glyphs?

Hello, Is there a way to set or change the stroke weight attribute across a whole bunch of glyphs rather than individually path by path, glyph by glyph?
I’ve got all glyphs stroked with one weight and want to increase the weight to make a heavier version.
Cheers
Jamie

Paste this in the Macro Window and adjust weight and width accordingly for all selected layers:

height = 30
width = 30

for layer in Font.selectedLayers:
	for path in layer.paths:
		path.attributes["strokeHeight"] = height
		path.attributes["strokeWidth"] = width

(Of course also click “Run” after adjusting the values)

4 Likes

Will do! Thanks very much, that’s super helpful.

There is a mekkablue script for that.

3 Likes

Thanks!

Is there a shortcut to make stroke weight increase/decrease?

No, but one could write two scripts and assign shortcuts to them.

1 Like

If the ‘W’ or ‘H’ field is active, you can increase/decrease the value by using the Up and Down arrow keys. Hold down Shift for steps of size 10, Shift-Command for steps of size 100.

1 Like

I wonder if that would be a good exercise for someone’s first script. I’ll see if I can give it a shot. I’ve really been wanting to try to learn scripting. I do use your tip all the time to decrease the opacity of the image from the macro panel.

If you reuse a macro frequently, I recommend creating your own scripts collection. Then the script appears in the Script menu and you can assign it a keyboard shortcut. See:

TL,DR. There are scripts for batch applying stroke attributes.