Skip to content

Commit

Permalink
remove instance UFOs before calling mutatormath
Browse files Browse the repository at this point in the history
Fixes #372
  • Loading branch information
anthrotype committed Dec 5, 2017
1 parent c53a5b3 commit 6cdf44e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Lib/fontmake/font_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import logging
import math
import os
import shutil
import tempfile
try:
from plistlib import load as readPlist # PY3
Expand Down Expand Up @@ -411,6 +412,14 @@ def run_from_designspace(
ufos.extend(reader.getSourcePaths())
if interpolate:
logger.info('Interpolating master UFOs from designspace')
_, ilocs = self._designspace_locations(designspace_path)
for ipath in ilocs.keys():
# mutatorMath does not remove the existing instance UFOs
# so we do it ourselves, or else strange things happen...
# https://github.com/googlei18n/fontmake/issues/372
if ipath.endswith(".ufo") and os.path.isdir(ipath):
logger.debug("Removing %s" % ipath)
shutil.rmtree(ipath)
results = build_designspace(
designspace_path, outputUFOFormatVersion=3,
roundGeometry=not no_round)
Expand Down

0 comments on commit 6cdf44e

Please sign in to comment.