summaryrefslogtreecommitdiff
path: root/misc/pylib/fontbuild/decomposeGlyph.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'misc/pylib/fontbuild/decomposeGlyph.pyx')
-rw-r--r--misc/pylib/fontbuild/decomposeGlyph.pyx23
1 files changed, 0 insertions, 23 deletions
diff --git a/misc/pylib/fontbuild/decomposeGlyph.pyx b/misc/pylib/fontbuild/decomposeGlyph.pyx
deleted file mode 100644
index 0470fa60b..000000000
--- a/misc/pylib/fontbuild/decomposeGlyph.pyx
+++ /dev/null
@@ -1,23 +0,0 @@
-def decomposeGlyph(font, glyph):
- """Moves the components of a glyph to its outline."""
- if len(glyph.components):
- deepCopyContours(font, glyph, glyph, (0, 0), (1, 1))
- glyph.clearComponents()
-
-
-def deepCopyContours(font, parent, component, offset, scale):
- """Copy contours to parent from component, including nested components."""
-
- for nested in component.components:
- 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
- for contour in component:
- contour = contour.copy()
- contour.scale(scale)
- contour.move(offset)
- parent.appendContour(contour)