Skip to content

Commit

Permalink
Add some comments at main putGlyph sections
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Sep 3, 2023
1 parent f9f5f92 commit 6b57e82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fontra/backends/designspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ async def putGlyph(self, glyphName, glyph, unicodes):
localAxes = packLocalAxes(glyph.axes)
localAxisNames = {axis.name for axis in glyph.axes}

# Prepare UFO source layers and local sources
sourceNameMapping = {}
layerNameMapping = {}
localSources = []

for source in glyph.sources:
sourceInfo = self._prepareUFOSourceLayer(
source, localAxisNames, revLayerNameMapping
Expand All @@ -304,6 +304,7 @@ async def putGlyph(self, glyphName, glyph, unicodes):
if sourceInfo.localSourceDict is not None:
localSources.append(sourceInfo.localSourceDict)

# Prepare local design space
localDS = {}
if localAxes:
localDS["axes"] = localAxes
Expand All @@ -312,6 +313,7 @@ async def putGlyph(self, glyphName, glyph, unicodes):

revLayerNameMapping = reverseSparseDict(layerNameMapping)

# Gather all UFO layers
usedLayers = set()
layers = []
for layerName, layer in glyph.layers.items():
Expand All @@ -328,6 +330,7 @@ async def putGlyph(self, glyphName, glyph, unicodes):
layers.append((layer, ufoLayer))
usedLayers.add(layerName)

# Write all UFO layers
hasVariableComponents = glyphHasVariableComponents(glyph)
modTimes = set()
for layer, ufoLayer in layers:
Expand All @@ -352,6 +355,7 @@ async def putGlyph(self, glyphName, glyph, unicodes):

modTimes.add(glyphSet.getGLIFModificationTime(glyphName))

# Prune unused UFO layers
relevantLayerNames = set(
layer.fontraLayerName
for layer in self.ufoLayers
Expand Down

0 comments on commit 6b57e82

Please sign in to comment.