diff --git a/Lib/fontmake/font_project.py b/Lib/fontmake/font_project.py index 070797a3..85e91a69 100644 --- a/Lib/fontmake/font_project.py +++ b/Lib/fontmake/font_project.py @@ -20,6 +20,7 @@ import logging import math import os +import shutil import tempfile try: from plistlib import load as readPlist # PY3 @@ -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)