Skip to content

Commit

Permalink
fix for #1443: replace 'google-font-download' with direct downloads o…
Browse files Browse the repository at this point in the history
…f the fonts (#1444)
  • Loading branch information
peterkaminski authored Feb 28, 2021
1 parent d0daf99 commit 28dade1
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 21 deletions.
1 change: 0 additions & 1 deletion check-vendor-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 siteapp/static
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 siteapp/static/vendor/emojione/emojione-sprite-24-travel@2x.png
9643c4f2b950f462f71ea15ffab848c949f3fe72a8a4a01e0a082f4d580ac754 siteapp/static/vendor/emojione/emojione-sprite-24.min.css
4f59f47836471cf3f02edfb217afdf107bf29cfe25c424c8c514a32712fc2ee8 siteapp/static/vendor/fontawesome.js
990e7373d100faee6fa7d92c1277695520e3c502f726bb28ce03d2b6d2cd3e6c siteapp/static/vendor/google-fonts.css
6375a7ecbb77ba42e2de22c99aab9fea1fea125d6d857512360a3a555ff74161 siteapp/static/vendor/Hind_400.woff
d7a3280717b1f82f46bee459863720a03de43b16dc8097ba1b133440e5fe0edc siteapp/static/vendor/Hind_400.woff2
a3ef4f13a191d01ecca06b8b997a666b28d4c614d6de256753fa9f4fbe15b726 siteapp/static/vendor/Hind_700.woff
Expand Down
49 changes: 31 additions & 18 deletions fetch-vendor-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,34 @@ download \

# google fonts
# Hind: SIL Open Font License 1.1
# first download a helper (note: we're about to run a foreign script locally)
# TODO: Requires bash v4 not available on macOS.
download \
https://raw.githubusercontent.com/neverpanic/google-font-download/d7bb34e0c5fa01d9411213fd1a1363317d3ceb11/google-font-download \
/tmp/google-font-download \
'95195992a6bb551755e8871e7570a544b047f46bcc253f0f3691f0d657a5a620'
(cd $VENDOR; bash /tmp/google-font-download -f woff,woff2 -o google-fonts.css Hind:400 Hind:700 Lato:900)
rm -f /tmp/google-font-download
# generated with: $SHACMD $VENDOR/{google-fonts.css,Hind*,Lato*}
$SHACMD_CHECK << EOF
faf874b09bc8220042ee61d072a5a5de49eac3275b5fe4917ed336461e35080a siteapp/static/vendor/google-fonts.css
6375a7ecbb77ba42e2de22c99aab9fea1fea125d6d857512360a3a555ff74161 siteapp/static/vendor/Hind_400.woff
d7a3280717b1f82f46bee459863720a03de43b16dc8097ba1b133440e5fe0edc siteapp/static/vendor/Hind_400.woff2
a3ef4f13a191d01ecca06b8b997a666b28d4c614d6de256753fa9f4fbe15b726 siteapp/static/vendor/Hind_700.woff
e2f1a473a1649fe316dbddc5cf8f45c525d62b8373d1be395272864c0cf1e60f siteapp/static/vendor/Hind_700.woff2
7831e273f41fef8485564286f3578d2847754db375befdb48b8ce37e1e1f3a57 siteapp/static/vendor/Lato_900.woff
7d4243c8e973ec0cfc707904891ae4e3efc03dbc8923acb9755f9a35c92269a6 siteapp/static/vendor/Lato_900.woff2
EOF
# Lato: SIL Open Font License 1.1
# to get static download locations, use https://github.com/neverpanic/google-font-download
download \
https://fonts.gstatic.com/s/hind/v11/5aU69_a8oxmIdGl4Ag.woff \
$VENDOR/Hind_400.woff \
'6375a7ecbb77ba42e2de22c99aab9fea1fea125d6d857512360a3a555ff74161'

download \
https://fonts.gstatic.com/s/hind/v11/5aU69_a8oxmIdGl4BA.woff2 \
$VENDOR/Hind_400.woff2 \
'd7a3280717b1f82f46bee459863720a03de43b16dc8097ba1b133440e5fe0edc'

download \
https://fonts.gstatic.com/s/hind/v11/5aU19_a8oxmIfNJdERySiw.woff \
$VENDOR/Hind_700.woff \
'a3ef4f13a191d01ecca06b8b997a666b28d4c614d6de256753fa9f4fbe15b726'

download \
https://fonts.gstatic.com/s/hind/v11/5aU19_a8oxmIfNJdERySjQ.woff2 \
$VENDOR/Hind_700.woff2 \
'e2f1a473a1649fe316dbddc5cf8f45c525d62b8373d1be395272864c0cf1e60f'

download \
https://fonts.gstatic.com/s/lato/v17/S6u9w4BMUTPHh50XSwiPHw.woff \
$VENDOR/Lato_900.woff \
'7831e273f41fef8485564286f3578d2847754db375befdb48b8ce37e1e1f3a57'

download \
https://fonts.gstatic.com/s/lato/v17/S6u9w4BMUTPHh50XSwiPGQ.woff2 \
$VENDOR/Lato_900.woff2 \
'7d4243c8e973ec0cfc707904891ae4e3efc03dbc8923acb9755f9a35c92269a6'
30 changes: 30 additions & 0 deletions siteapp/static/css/google-fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@font-face {
font-family: 'Hind';
font-style: normal;
font-weight: 400;
src:
/* from https://fonts.gstatic.com/s/hind/v11/5aU69_a8oxmIdGl4Ag.woff */
url('../vendor/Hind_400.woff') format('woff'),
/* from https://fonts.gstatic.com/s/hind/v11/5aU69_a8oxmIdGl4BA.woff2 */
url('../vendor/Hind_400.woff2') format('woff2');
}
@font-face {
font-family: 'Hind';
font-style: normal;
font-weight: 700;
src:
/* from https://fonts.gstatic.com/s/hind/v11/5aU19_a8oxmIfNJdERySiw.woff */
url('../vendor/Hind_700.woff') format('woff'),
/* from https://fonts.gstatic.com/s/hind/v11/5aU19_a8oxmIfNJdERySjQ.woff2 */
url('../vendor/Hind_700.woff2') format('woff2');
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 900;
src:
/* from https://fonts.gstatic.com/s/lato/v17/S6u9w4BMUTPHh50XSwiPHw.woff */
url('../vendor/Lato_900.woff') format('woff'),
/* from https://fonts.gstatic.com/s/lato/v17/S6u9w4BMUTPHh50XSwiPGQ.woff2 */
url('../vendor/Lato_900.woff2') format('woff2');
}
2 changes: 1 addition & 1 deletion templates/base-conditional.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<link rel="stylesheet" href="{% static "vendor/bootstrap/css/bootstrap.min.css" %}">
{% endif %}
{% if 'google-fonts.css' in args %}
<link rel="stylesheet" href="{% static "vendor/google-fonts.css" %}">
<link rel="stylesheet" href="{% static "css/google-fonts.css" %}">
{% endif %}
{% if 'govready-q.css' in args %}
<link rel="stylesheet" href="{% static "css/govready-q.css" %}">
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<link rel="stylesheet" href="{% static "vendor/bootstrap/css/bootstrap.min.css" %}">
<link rel="stylesheet" href="{% static "vendor/google-fonts.css" %}">
<link rel="stylesheet" href="{% static "css/google-fonts.css" %}">
<link rel="stylesheet" href="{% static "css/govready-q.css" %}">
<link rel="stylesheet" href="{% static "vendor/bootstrap/css/bootstrap-theme.min.css" %}">
<link rel="stylesheet" href="{% static "vendor/jsgrid/jsgrid.min.css" %}">
Expand Down

0 comments on commit 28dade1

Please sign in to comment.