nerd-fonts/update.sh

58 lines
1.7 KiB
Bash
Raw Permalink Normal View History

2021-12-31 18:08:01 +01:00
#!/usr/bin/env bash
2021-11-15 14:02:33 +01:00
echo "Downloading 'font-patcher' script..."
2021-12-31 18:08:01 +01:00
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/font-patcher -o ./font-patcher
2021-11-15 14:02:33 +01:00
chmod 755 ./font-patcher
for path in codicons font-awesome materialdesign octicons powerline-symbols weather-icons; do
2021-12-31 18:08:01 +01:00
mkdir -p ./src/glyphs/"$path"
done
mkdir -p ./bin/scripts/name_parser
2021-12-31 18:08:01 +01:00
glyphs=(
"codicons/codicon.ttf"
"font-awesome/FontAwesome.otf"
2023-03-22 18:08:11 +01:00
"materialdesign/MaterialDesignIconsDesktop.ttf"
"materialdesign/MaterialDesignIconsDesktop_orig.ttf"
"octicons/octicons.ttf"
2021-12-31 18:08:01 +01:00
"powerline-symbols/PowerlineSymbols.otf"
"weather-icons/weathericons-regular-webfont.ttf"
"Pomicons.otf"
"PowerlineExtraSymbols.otf"
"Unicode_IEC_symbol_font.otf"
"devicons.ttf"
2023-03-22 18:08:11 +01:00
"extraglyphs.sfd"
2021-12-31 18:08:01 +01:00
"font-awesome-extension.ttf"
"font-logos.ttf"
"materialdesignicons-webfont.ttf"
"original-source.otf"
)
name_parser=(
"FontnameParser.py"
"FontnameTools.py"
"query_monospace"
"query_names"
"query_panose"
"query_sftn"
"query_version"
)
2021-12-31 18:08:01 +01:00
upstream_src_glyphs_url="https://github.com/ryanoasis/nerd-fonts/raw/master/src/glyphs"
upstream_name_parser_url="https://github.com/ryanoasis/nerd-fonts/raw/master/bin/scripts/name_parser"
2021-12-31 18:08:01 +01:00
echo "Downloading glyph fonts..."
2021-12-31 18:08:01 +01:00
for glyph in "${glyphs[@]}"; do
# replace all `whitespace` characters with `%20`
percent_encoded_uri="${upstream_src_glyphs_url}/${glyph//\ /%20}"
curl -fSL "${percent_encoded_uri}" -o "src/glyphs/${glyph}"
2021-12-31 18:08:01 +01:00
done
find ./src/glyphs/ -type f -exec chmod 644 '{}' \;
echo "Downloading helper scripts for font-patcher ..."
for file in "${name_parser[@]}"; do
curl -fSL "${upstream_name_parser_url}/${file}" -o "bin/scripts/name_parser/${file}"
done
find ./bin/scripts/name_parser/ -type f -exec chmod 644 '{}' \;