Expand outlines for every glyph across masters

Hi - using Glyphs 3 I’ve created a font with live strokes that has 3 masters

There’s an issue with exporting the live strokes as a GX because not all nodes match up even if paths are compatible - also I want to go in to some characters and make some optical tweaks.

I know you can right click on one glyph with the path selected and click “Expand Outline” but is there a way to universally expand the live strokes for every glyph in the font?

Thanks

I feel like I should be able to select all the glyphs in the Font tab, right click and Expand Outline that way. Am I missing something?

Yes. It is very likely that different expansions require different point arrangements. That is why stroke expansion does not work as OTVars currently, only as static font export.

That should be a function in the app, you are right. Currently missing. I’ll put it on the list. I’ll see if I can come up with a quick scripting solution.

1 Like

Thanks very much Rainer that would be great

It is possible to export OTvar from strokes: if you happen to get compatible outlines. The problem is mostly with rounded endings on diagonal strokes.

Thanks Georg, yes I was able to export otvar successfully with live stroke with rounded terminals until I made the stroke weight too fine, I think breaking point was around W40. When the stroke weight got very light the rounded terminals on the angled glyphs got less nodes than bolder weights.

I could add a ‘keep compatibility’ option to the stokes, but that could cause visible bumps with visible strokes.
Increasing the UPM might help?

This expands all paths on all foreground layers in the font. Careful: there is a bug in the current app beta, the effect of the script cannot be undone. So make sure you work on a copy of the .glyphs file.

for g in Font.glyphs:
	for l in g.layers:
		if l.isMasterLayer or l.isSpecialLayer:
			l.flattenOutlinesRemoveOverlap_origHints_secondaryPath_extraHandles_error_(False,None,None,None,None)

Paste it in Macro Window, and press Run. It will expand paths of all glyphs in the frontmost font.

4 Likes

That is not a bug but a feature. The function is (for now) only used to prepare for displaying the UI and when exporting. In both cases, you don’t like any interactions with undo. I’ll see if I can refactor that to make it useful for applying it manually.

Hi thanks for the responses.
@GeorgSeifert I tried a file with a UPM of 5000 (random but easy) but still got 3 nodes on the rounded terminal of a fine stroke compared to 4 nodes on a thicker stroke. Is that what you meant? “Keep compatibility” would be great depending on how common / extreme the bumps were.
@mekkablue thanks for the script. Not sure I did it right. I pasted it into the macro panel (the font has 6 masters in the file) and hit Run but didn’t see any effect and got this message:
"Traceback (most recent call last):
File “”, line 4
AttributeError: ‘NSKVONotifying_GSLayer’ object has no attribute ‘flattenOutlinesRemoveOverlap_origHints_secondaryPath_extraHandles_error_’:

Thanks again.

Make sure you have the latest beta: Go to Glyphs > Preferences > Updates, activate both checkboxes and press the Update button.

Thanks the update did the trick and the script worked. On exporting the GX I got a “too many inflections” error which seemed weird because the glyphs are all very simple. I think due to the way the script had rendered the open corners with handles (?) After removing those handles across all the masters the export worked fine thanks again. Screen Shot 2021-03-30 at 10.34.49 PM

1 Like

Hi!
In addition to Expand outline, is there a way to change stroke width in multiple glyphs at once?
thanks!

Before expanding? There’s a mekkablue script called Paths > Batch-Set Path Attributes:

amazing! thank you so much, Rainer!