-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add script to get fonts on build
Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
1a3411f
commit c1ee441
Showing
9 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/assets/fonts | ||
tests/clover.xml | ||
.idea | ||
node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
src | ||
build | ||
.git | ||
tests | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fonts will be added here during release build thorugh the build/download-fonts.sh script. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# Download font files and put them into the assets/fonts folder for the release | ||
|
||
FONTLIST=( | ||
"https://github.com/google/fonts/raw/main/ofl/amaticsc/AmaticSC-Regular.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/amaticsc/AmaticSC-Bold.ttf" | ||
"https://github.com/google/fonts/blob/main/ofl/caveat/Caveat%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/comfortaa/Comfortaa%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/ebgaramond/EBGaramond%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/lexend/Lexend%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/lobster/Lobster-Regular.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/lora/Lora%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/montserrat/Montserrat%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/nunito/Nunito%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/oswald/Oswald%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/pacifico/Pacifico-Regular.ttf" | ||
"https://github.com/google/fonts/raw/main/ofl/playfairdisplay/PlayfairDisplay%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/blob/main/ofl/roboto/Roboto%5Bwdth%2Cwght%5D.ttf" | ||
"https://github.com/google/fonts/raw/main/apache/robotomono/RobotoMono%5Bwght%5D.ttf" | ||
"https://github.com/google/fonts/blob/main/ofl/spectral/Spectral-Regular.ttf" | ||
) | ||
|
||
rm assets/fonts/* | ||
|
||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } | ||
|
||
for font in "${FONTLIST[@]}"; do | ||
echo "$font" | ||
wget -q -P assets/fonts/ $font | ||
|
||
FILENAME=$(urldecode "$(basename "$font")") | ||
|
||
if [[ $FILENAME == *"wght"* ]]; then | ||
NEWFILENAME=$(echo $FILENAME | sed 's/\[wght\]/-wght/g') | ||
NEWFILENAME=$(echo $NEWFILENAME | sed 's/\[wdth,wght\]/-wdtg-wght/g') | ||
mv assets/fonts/$FILENAME assets/fonts/$NEWFILENAME | ||
else | ||
NEWFILENAME=$(echo $FILENAME) | ||
fi | ||
|
||
echo "$FILENAME" | ||
FONTNAME=$(echo $NEWFILENAME | sed 's/.ttf//g') | ||
|
||
echo "$(dirname $font)/OFL.txt" | ||
wget -q -O "assets/fonts/$FONTNAME.LICENSE.txt" "$(dirname $font)/OFL.txt" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters