Skip to content

Commit

Permalink
Simplify by not repeating condition
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Jul 13, 2024
1 parent b87d94b commit 24aaaf6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/fontra_compile/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ def buildCharString(glyph, glyphSources, defaultLayerGlyph, model):
pen = T2CharStringPen(None, None, CFF2=True)
defaultLayerGlyph.path.drawPoints(PointToSegmentPen(pen))
charString = pen.getCharString()
charStringSupports = None
else:
if model.reverseMapping[0] != 0:
# For some reason, CFF2CharStringMergePen requires the first source
Expand All @@ -773,13 +774,11 @@ def buildCharString(glyph, glyphSources, defaultLayerGlyph, model):
pen.restart(sourceIndex)
layerGlyph = glyph.layers[source.layerName].glyph
layerGlyph.path.drawPoints(pointPen)
charString = pen.getCharString(var_model=model)

charStringSupports = (
tuple(tuple(sorted(sup.items())) for sup in model.supports[1:])
if model is not None
else None
)
charString = pen.getCharString(var_model=model)
charStringSupports = tuple(
tuple(sorted(sup.items())) for sup in model.supports[1:]
)

return charString, charStringSupports

Expand Down

0 comments on commit 24aaaf6

Please sign in to comment.