Skip to content

Commit

Permalink
Merge pull request #496 from madig/build_masters-use-dict-instead-of-…
Browse files Browse the repository at this point in the history
…generator

build_masters: remember written fonts instead of filtering source layers
  • Loading branch information
madig authored Jan 30, 2019
2 parents 31bca5d + 3c7bd2a commit 2365fd7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Lib/glyphsLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ def build_masters(
)

# Only write full masters to disk. This assumes that layer sources are always part
# of another full master source, which should always be the case in a .glyphs file.
ufos = []
for source in (s for s in designspace.sources if s.layerName is None):
ufos.append(source.font)
# of another full master source, which must always be the case in a .glyphs file.
ufos = {}
for source in designspace.sources:
if source.filename in ufos:
assert source.font is ufos[source.filename]
continue

if create_background_layers:
ufo_create_background_layer_for_all_glyphs(source.font)
Expand All @@ -145,6 +147,8 @@ def build_masters(

ufonormalizer.normalizeUFO(ufo_path, writeModTimes=False)

ufos[source.filename] = source.font

if not designspace_path:
designspace_path = os.path.join(master_dir, designspace.filename)
designspace.write(designspace_path)
Expand Down

0 comments on commit 2365fd7

Please sign in to comment.