From 0daeb0f6be366f82981ba140f627b5d5dac16159 Mon Sep 17 00:00:00 2001 From: Atesca Date: Tue, 4 Oct 2022 17:28:08 +0200 Subject: [PATCH 1/2] Fix splitting shell command --- tasks/engines/fontforge/generate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/engines/fontforge/generate.py b/tasks/engines/fontforge/generate.py index 01fde68..ef42b2b 100644 --- a/tasks/engines/fontforge/generate.py +++ b/tasks/engines/fontforge/generate.py @@ -7,6 +7,7 @@ import re from subprocess import call from distutils.spawn import find_executable +import shlex args = json.load(sys.stdin) @@ -98,7 +99,7 @@ def generate(filename): # Hint the TTF file # ttfautohint is optional if args['autoHint'] and find_executable('ttfautohint'): - 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=False) + call(shlex.split('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=False) f = fontforge.open(fontfile + '.ttf') # SVG @@ -132,7 +133,7 @@ def generate(filename): # EOT if 'eot' in args['types']: # eotlitetool.py script to generate IE7-compatible .eot fonts - call('python "%(path)s/../../bin/eotlitetool.py" "%(font)s.ttf" --output "%(font)s.eot"' % {'path': scriptPath, 'font': fontfile}, shell=False) + call(shlex.split('python "%(path)s/../../bin/eotlitetool.py" "%(font)s.ttf" --output "%(font)s.eot"' % {'path': scriptPath, 'font': fontfile}), shell=False) # Delete TTF if not needed if ('ttf' not in args['types']) and woff2_generated: From 48dc9936474c5f92856320e473fc2282d40c952f Mon Sep 17 00:00:00 2001 From: Atesca Date: Tue, 4 Oct 2022 17:34:15 +0200 Subject: [PATCH 2/2] Remove overwriting default parameter with same value --- tasks/engines/fontforge/generate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/engines/fontforge/generate.py b/tasks/engines/fontforge/generate.py index ef42b2b..4403da5 100644 --- a/tasks/engines/fontforge/generate.py +++ b/tasks/engines/fontforge/generate.py @@ -99,7 +99,7 @@ def generate(filename): # Hint the TTF file # ttfautohint is optional if args['autoHint'] and find_executable('ttfautohint'): - call(shlex.split('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=False) + call(shlex.split('ttfautohint --symbol --fallback-script=latn --no-info "%(font)s.ttf" "%(font)s-hinted.ttf" && mv "%(font)s-hinted.ttf" "%(font)s.ttf"' % {'font': fontfile})) f = fontforge.open(fontfile + '.ttf') # SVG @@ -133,7 +133,7 @@ def generate(filename): # EOT if 'eot' in args['types']: # eotlitetool.py script to generate IE7-compatible .eot fonts - call(shlex.split('python "%(path)s/../../bin/eotlitetool.py" "%(font)s.ttf" --output "%(font)s.eot"' % {'path': scriptPath, 'font': fontfile}), shell=False) + call(shlex.split('python "%(path)s/../../bin/eotlitetool.py" "%(font)s.ttf" --output "%(font)s.eot"' % {'path': scriptPath, 'font': fontfile})) # Delete TTF if not needed if ('ttf' not in args['types']) and woff2_generated: