Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Delete processed layer when --write-default-layer option is used
Browse files Browse the repository at this point in the history
Fixes #171
  • Loading branch information
miguelsousa committed Jun 3, 2019
1 parent a280535 commit 9ca5a58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion python/psautohint/ufoFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,12 @@ def save(self, path):

# Write layer contents.
layers = writer.layerContents.copy()
if self.processedLayerGlyphMap or not self.writeToDefaultLayer:
if self.writeToDefaultLayer and PROCESSED_LAYER_NAME in layers:
# Delete processed glyphs directory
writer.deleteGlyphSet(PROCESSED_LAYER_NAME)
# Remove entry from 'layercontents.plist' file
del layers[PROCESSED_LAYER_NAME]
elif self.processedLayerGlyphMap or not self.writeToDefaultLayer:
layers[PROCESSED_LAYER_NAME] = PROCESSED_GLYPHS_DIRNAME
writer.layerContents.update(layers)
writer.writeLayerContents()
Expand Down

0 comments on commit 9ca5a58

Please sign in to comment.