Skip to content

Commit

Permalink
Update how Google Font files are fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 9, 2024
1 parent 71204d3 commit ae8a73d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Makefile-fonts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ notobase = $(shell sed -e 's/-.*//' <<< $(notdir $1))
.fonts/Noto%.ttc: | .fonts
curl -fsSL https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/$(notdir $@) -o $@

.fonts/EBGaramond-Regular.ttf: | .fonts
curl -fsSL https://fonts.googleapis.com/css?family=EB%20Garamond:400 |
sed -ne '/src:/{s/.*url(//;s/).*//;p}' |
xargs curl -fsSL -o $@
touch $@

.fonts/Estonia-Regular.ttf: | .fonts
curl -fsSL https://fonts.googleapis.com/css?family=Estonia:400 |
sed -ne '/src:/{s/.*url(//;s/).*//;p}' |
xargs curl -fsSL -o $@
touch $@

# Tell make how to download font file bundles (when not downloadable individually)

.sources/acorn-initials.zip: | .sources
Expand All @@ -73,12 +85,6 @@ notobase = $(shell sed -e 's/-.*//' <<< $(notdir $1))
.sources/dejavu-fonts-ttf-2.37.tar.bz2: | .sources
curl -fsSL https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/$(notdir $@) -o $@

.sources/EB_Garamond.zip: | .sources
curl -fsSL https://fonts.google.com/download?family=EB%20Garamond -o $@

.sources/Estonia.zip: | .sources
curl -fsSL https://fonts.google.com/download?family=Estonia -o $@

.sources/GentiumPlus-5.000.zip: | .sources
curl -fsSL https://software.sil.org/downloads/r/gentium/$(notdir $@) -o $@

Expand Down Expand Up @@ -120,14 +126,6 @@ notobase = $(shell sed -e 's/-.*//' <<< $(notdir $1))
bsdtar -x -f $< -C $(dir $@) --strip-components 2 $(basename $(basename $(<F)))/ttf/$(notdir $@)
touch $@

.fonts/EBGaramond-%: .sources/EB_Garamond.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 static/$(notdir $@)
touch $@

.fonts/Estonia-%: .sources/Estonia.zip | .fonts
bsdtar -x -f $< -C $(dir $@) $(notdir $@)
touch $@

.fonts/GentiumPlus%: .sources/GentiumPlus-5.000.zip | .fonts
bsdtar -x -f $< -C $(dir $@) --strip-components 1 $(basename $(<F))/$(notdir $@)
touch $@
Expand Down

0 comments on commit ae8a73d

Please sign in to comment.