Skip to content

Commit

Permalink
copy anchors and guidelines while decomposing
Browse files Browse the repository at this point in the history
  • Loading branch information
typemytype committed May 30, 2024
1 parent 66172cc commit 06c8772
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Lib/ufoProcessor/ufoOperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,11 +1144,26 @@ def collectSourcesForGlyph(self, glyphName, decomposeComponents=False, discreteL
if decomposeComponents:
# what about decomposing glyphs in a partial font?
temp = self.glyphClass()
p = temp.getPointPen()
dpp = DecomposePointPen(sourceLayer, p)
sourceGlyphObject.drawPoints(dpp)
sourceGlyphObject.drawPoints(
DecomposePointPen(sourceLayer, temp.getPointPen())
)
temp.width = sourceGlyphObject.width
temp.name = sourceGlyphObject.name
temp.anchors = [dict(
x=anchor.x,
y=anchor.y,
name=anchor.name,
identifier=anchor.identifier,
color=anchor.color
) for anchor in sourceGlyphObject.anchors]
temp.guidelines = [dict(
x=guideline.x,
y=guideline.y,
angle=guideline.angle,
name=guideline.name,
identifier=guideline.identifier,
color=guideline.color
) for guideline in sourceGlyphObject.guidelines]
processThis = temp
else:
processThis = sourceGlyphObject
Expand Down

0 comments on commit 06c8772

Please sign in to comment.