# Expand outlines for every glyph across masters

**URL:** <https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420>\
**Category:** Glyphs\
**Created:** [March 28, 2021, 2:54am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420 "2021-03-28T02:54:21Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 28, 2021, 2:54am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/1 "2021-03-28T02:54:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 28, 2021, 3:06pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/2 "2021-03-28T15:06:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mekkablue](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/mekkablue/32/23_2.png) [@mekkablue](https://forum.glyphsapp.com/u/mekkablue)\
**Post date:** [March 28, 2021, 4:59pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/3 "2021-03-28T16:59:21Z")

</div>

> [@reggaecowboy](#):
>
> There’s an issue with exporting the live strokes as a GX because not all nodes match up even if paths are compatible

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.

> [@](#):
>
> I feel like I should be able to select all the glyphs in the Font tab, right click and Expand Outline that way.

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.

---

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 28, 2021, 5:36pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/4 "2021-03-28T17:36:19Z")

</div>

Thanks very much Rainer that would be great

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [March 28, 2021, 7:04pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/5 "2021-03-28T19:04:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 28, 2021, 7:28pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/6 "2021-03-28T19:28:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [March 28, 2021, 10:07pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/7 "2021-03-28T22:07:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mekkablue](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/mekkablue/32/23_2.png) [@mekkablue](https://forum.glyphsapp.com/u/mekkablue)\
**Post date:** [March 29, 2021, 9:09am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/8 "2021-03-29T09:09:40Z")

</div>

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.

```python
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.

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [March 29, 2021, 12:45pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/9 "2021-03-29T12:45:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 30, 2021, 1:26am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/10 "2021-03-30T01:26:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mekkablue](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/mekkablue/32/23_2.png) [@mekkablue](https://forum.glyphsapp.com/u/mekkablue)\
**Post date:** [March 30, 2021, 8:30am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/11 "2021-03-30T08:30:00Z")

</div>

Make sure you have the latest beta: Go to _Glyphs \> Preferences \> Updates,_ activate both checkboxes and press the _Update_ button.

---

<div class="post-metadata">

**Author:** ![reggaecowboy](https://forum.glyphsapp.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@reggaecowboy](https://forum.glyphsapp.com/u/reggaecowboy)\
**Post date:** [March 31, 2021, 2:46am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/12 "2021-03-31T02:46:05Z")

</div>

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](https://forum.glyphsapp.com/uploads/default/original/2X/4/4b4d827c847a58808c5119250e90b5a0bffb385f.png)

---

<div class="post-metadata">

**Author:** ![zakhar](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/zakhar/32/19799_2.png) [@zakhar](https://forum.glyphsapp.com/u/zakhar)\
**Post date:** [November 2, 2023, 5:41pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/13 "2023-11-02T17:41:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mekkablue](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/mekkablue/32/23_2.png) [@mekkablue](https://forum.glyphsapp.com/u/mekkablue)\
**Post date:** [November 3, 2023, 1:30am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/14 "2023-11-03T01:30:41Z")

</div>

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

 ![image](https://forum.glyphsapp.com/uploads/default/original/3X/6/e/6ed9d25d10e991255085e7e403f732d50b0870bf.png)

---

<div class="post-metadata">

**Author:** ![zakhar](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/zakhar/32/19799_2.png) [@zakhar](https://forum.glyphsapp.com/u/zakhar)\
**Post date:** [November 3, 2023, 12:41pm UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/15 "2023-11-03T12:41:09Z")

</div>

amazing! thank you so much, Rainer!

---

<div class="post-metadata">

**Author:** ![alvaro](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/alvaro/32/25381_2.png) [@alvaro](https://forum.glyphsapp.com/u/alvaro)\
**Post date:** [November 8, 2024, 10:56am UTC](https://forum.glyphsapp.com/t/expand-outlines-for-every-glyph-across-masters/18420/16 "2024-11-08T10:56:39Z")

</div>

It would be super handy if one of the position settings was “retain existing position”
