From 473a79fbb6684cb1bec1d568069e407c6011172f Mon Sep 17 00:00:00 2001 From: lucaspetter Date: Wed, 27 Mar 2019 09:01:28 -0700 Subject: [PATCH] Use global sfnt2woff-zopfli --- lib/fontcustom/scripts/generate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/fontcustom/scripts/generate.py b/lib/fontcustom/scripts/generate.py index dfe6bee7..06c5829c 100755 --- a/lib/fontcustom/scripts/generate.py +++ b/lib/fontcustom/scripts/generate.py @@ -120,9 +120,12 @@ def createGlyph( name, source, code ): subprocess.Popen([scriptPath + '/sfnt2woff', fontfile + '.ttf'], stdout=subprocess.PIPE) except OSError: # If the local version of sfnt2woff fails (i.e., on Linux), try to use the - # global version. This allows us to avoid forcing OS X users to compile - # sfnt2woff from source, simplifying install. - subprocess.call(['sfnt2woff', fontfile + '.ttf']) + # global version of sfnt2woff or sfnt2woff-zopfli. This allows us to avoid + # forcing OS X users to compile sfnt2woff from source, simplifying install. + try: + subprocess.call(['sfnt2woff-zopfli', fontfile + '.ttf']) + except OSError: + subprocess.call(['sfnt2woff', fontfile + '.ttf']) manifest['fonts'].append(fontfile + '.woff') # Convert EOT for IE7