Created
September 17, 2024 18:35
-
-
Save okay-type/c8b09f538521d2accb287c1205162c92 to your computer and use it in GitHub Desktop.
Decomposed nested components one level. In robofont, obvs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = CurrentFont() | |
for g in f.selectedGlyphs: | |
if len(g.components) > 0: | |
with g.undo('Nested Decompose ' + g.name): | |
for component in g.components: | |
baseGlyph = f[component.baseGlyph] | |
if len(baseGlyph.components) > 0: | |
pen = g.getPointPen() | |
baseGlyph.drawPoints(pen) | |
g.removeComponent(component) | |
else: | |
component.decompose() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment