summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-09-21 11:24:06 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-09-21 11:24:06 -0700
commit53ddf6da91536bfe4f09778a31c77c7d30f6ee35 (patch)
tree4057c1c1d1cc69456795e9882cd9d8f5cc8e3786 /scripts/lib/fontbuild
parenta9ff306231162a2a62d1dec67ac09da2169679fc (diff)
Rename decomposeGlyph's recursive helper function.
Diffstat (limited to 'scripts/lib/fontbuild')
-rw-r--r--scripts/lib/fontbuild/decomposeGlyph.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/lib/fontbuild/decomposeGlyph.py b/scripts/lib/fontbuild/decomposeGlyph.py
index 94b9404..8cab1b4 100644
--- a/scripts/lib/fontbuild/decomposeGlyph.py
+++ b/scripts/lib/fontbuild/decomposeGlyph.py
@@ -2,17 +2,18 @@ def decomposeGlyph(font, glyphName):
"""Moves the components of a glyph to its outline."""
glyph = font[glyphName]
- decompose(font, glyph, glyph, (0, 0), (1, 1))
+ deepCopyContours(font, glyph, glyph, (0, 0), (1, 1))
glyph.clearComponents()
-def decompose(font, parent, component, offset, scale):
+def deepCopyContours(font, parent, component, offset, scale):
"""Copy contours to parent from component, including nested components."""
for nested in component.components:
- decompose(font, parent, font[nested.baseGlyph],
- (offset[0] + nested.offset[0], offset[1] + nested.offset[1]),
- (scale[0] * nested.scale[0], scale[1] * nested.scale[1]))
+ deepCopyContours(
+ font, parent, font[nested.baseGlyph],
+ (offset[0] + nested.offset[0], offset[1] + nested.offset[1]),
+ (scale[0] * nested.scale[0], scale[1] * nested.scale[1]))
if component == parent:
return