From 722822978dd4183ed44661a634e5982270b52cbf Mon Sep 17 00:00:00 2001 From: Daniel Peukert Date: Sat, 20 Jun 2020 10:48:16 +0200 Subject: [PATCH 1/2] Allow local font names to be missing --- google-font-download | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/google-font-download b/google-font-download index bd3399f..73edda5 100755 --- a/google-font-download +++ b/google-font-download @@ -416,15 +416,10 @@ for family in "${families[@]}"; do # Determine the local names for the given fonts so we can use a locally-installed font if available. css_src_string=$(echo "$css_string" | grep "src:") - ret=0 - local_name=$(echo "$css_src_string" | grep -Eo "src: local\\('[^']+'\\)," | $ESED "s/^src: local\\('([^']+)'\\),$/\\1/g") || ret=$? - if [ $ret -ne 0 ]; then - errors=1 - printf >&2 "Failed to determine local font name\\n" - fi + local_name=$(echo "$css_src_string" | grep -Eo "src: local\\('[^']+'\\)," | $ESED "s/^src: local\\('([^']+)'\\),$/\\1/g") || true local_postscript_name=$(echo "$css_src_string" | grep -Eo ", local\\('[^']+'\\)," | $ESED "s/^, local\\('([^']+)'\\),$/\\1/g") || true - # When the local font name couldn't be determined, still produce a valid CSS file + # Some fonts don't have a local font name if [ -n "$local_name" ]; then printf >>"$css" "\\t\\tlocal('%s'),\\n" "$local_name" fi From 2c067932c96a4657e2516c02f902aad297efa7b0 Mon Sep 17 00:00:00 2001 From: Daniel Peukert Date: Sat, 20 Jun 2020 10:48:21 +0200 Subject: [PATCH 2/2] Add gitignore file --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a4c26db --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.css +*.woff2 +*.woff +*.eot +*.svg +*.ttf