From 918ee833fe027a83af6b650f55ce9e040914c225 Mon Sep 17 00:00:00 2001 From: "Esteban (jipi) Coria" Date: Fri, 15 Sep 2023 15:43:44 -0300 Subject: [PATCH] Update generate.py --- lib/engines/fontforge/generate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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')