diff --git a/lib/engines/fontforge/generate.py b/lib/engines/fontforge/generate.py index 082ed9d..43a0b99 100644 --- a/lib/engines/fontforge/generate.py +++ b/lib/engines/fontforge/generate.py @@ -5,7 +5,7 @@ import sys import json from subprocess import call -from distutils.spawn import find_executable +from shutil import which args = json.load(sys.stdin) @@ -60,7 +60,7 @@ def create_empty_char(f, c): create_empty_char(f, char) glyph = f.createChar(cp, name) glyph.addPosSub('liga', tuple(name)) - + else: glyph = f.createChar(cp) glyph.importOutlines(filePath) @@ -94,7 +94,7 @@ def generate(filename): # Hint the TTF file # ttfautohint is optional -if (find_executable('ttfautohint') and args['autoHint']): +if (which('ttfautohint') and args['autoHint']): call('ttfautohint --symbol --fallback-script=latn --no-info "%(font)s.ttf" "%(font)s-hinted.ttf" && mv "%(font)s-hinted.ttf" "%(font)s.ttf"' % {'font': fontfile}, shell=True) f = fontforge.open(fontfile + '.ttf')