From 637e50eb5e7042d7be2752b802e4e263e3ec01e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp=20=28TWiStErRob=29?= Date: Sun, 17 Mar 2019 16:24:22 +0000 Subject: [PATCH] Remove platform dependent code --- lib/fontcustom/scripts/generate.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/fontcustom/scripts/generate.py b/lib/fontcustom/scripts/generate.py index dfe6bee7..94a9db8c 100755 --- a/lib/fontcustom/scripts/generate.py +++ b/lib/fontcustom/scripts/generate.py @@ -1,5 +1,6 @@ import fontforge import os +import shutil import subprocess import tempfile import json @@ -126,16 +127,12 @@ def createGlyph( name, source, code ): manifest['fonts'].append(fontfile + '.woff') # Convert EOT for IE7 - subprocess.call('python ' + scriptPath + '/eotlitetool.py ' + fontfile + '.ttf -o ' + fontfile + '.eot', shell=True) - # check if windows - if os.name == 'nt': - subprocess.call('move ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True) - else: - subprocess.call('mv ' + fontfile + '.eotlite ' + fontfile + '.eot', shell=True) + subprocess.call(['python', scriptPath + '/eotlitetool.py', fontfile + '.ttf', '-o', fontfile + '.eot']) + shutil.move(fontfile + '.eotlite', fontfile + '.eot') manifest['fonts'].append(fontfile + '.eot') # Convert TTF to WOFF2 - subprocess.call('woff2_compress \'' + fontfile + '.ttf\'', shell=True) + subprocess.call(['woff2_compress', fontfile + '.ttf']) manifest['fonts'].append(fontfile + '.woff2') finally: