Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Nerd Fonts #235

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update Nerd Fonts to v3.1.1
Fetch script updated to handle the upstream sunsetting of in-repo releases (ryanoasis/nerd-fonts#1360).

The script will now fetch the tarball and extract the appropriate file.
  • Loading branch information
dragonmaus committed Mar 24, 2024
commit 8b05011a80f8354d27b9885f305daf170a785d61
62 changes: 34 additions & 28 deletions setup-nerd-fonts.sh
Original file line number Diff line number Diff line change
@@ -5,41 +5,47 @@ getNerdFont() {
local font_name="${1}"
local font_file="${2}"

local tag="v3.0.2"
local font_filename_remote="$font_name"
if [ "$font_filename_remote" != "Go-Mono" ]; then
font_filename_remote="${font_filename_remote//-/}"
echo "font_name=$font_name, font_filename_remote=$font_filename_remote"
fi
local url="https://github.com/ryanoasis/nerd-fonts/raw/${tag}/patched-fonts/${font_filename_remote}/${font_file}"
local tag="v3.1.1"
local font_pack="${font_name}"
case "${font_pack}" in
("Go-Mono")
# These fonts have hyphens in the pack name.
;;
(*)
# The rest don't.
font_pack="${font_pack//-/}"
;;
esac
local url="https://github.com/ryanoasis/nerd-fonts/releases/download/${tag}/${font_pack}.tar.xz"

local local_file="app/src/main/assets/fonts/${font_name}.ttf"
# Report which font is being downloaded, and keep a running count.
echo "Fetching ${url} ... [$(( ++font_counter ))/${#fonts[@]}]"
curl -fLo "${local_file}" "${url}"
curl -fLs "${url}" | tar -xJO -f - "${font_file}" > "${local_file}"
echo -e "\t-> Saved to ${local_file}"
}

declare -A fonts=( # [font-name]='path/to/file.ttf'
[Anonymous-Pro]='Regular/AnonymiceProNerdFontMono-Regular.ttf'
[DejaVu-Sans-Mono]='Regular/DejaVuSansMNerdFontMono-Regular.ttf'
[Fantasque-Sans-Mono]='Regular/FantasqueSansMNerdFontMono-Regular.ttf'
[Fira-Code]='Regular/FiraCodeNerdFontMono-Regular.ttf'
[Fira-Mono]='Regular/FiraMonoNerdFontMono-Regular.otf'
[Go-Mono]='Regular/GoMonoNerdFontMono-Regular.ttf'
[Hack]='Regular/HackNerdFontMono-Regular.ttf'
[Hermit]='Regular/HurmitNerdFontMono-Regular.otf'
[Inconsolata]='InconsolataNerdFontMono-Regular.ttf'
[Iosevka]='Regular/IosevkaNerdFontMono-Regular.ttf'
[Liberation-Mono]='LiterationMonoNerdFontMono-Regular.ttf'
[Meslo]='L/Regular/MesloLGLNerdFontMono-Regular.ttf'
[Monofur]='Regular/MonofurNerdFontMono-Regular.ttf'
[Monoid]='Regular/MonoidNerdFontMono-Regular.ttf'
[OpenDyslexic]='Mono-Regular/OpenDyslexicMNerdFontMono-Regular.otf'
[Roboto-Mono]='Regular/RobotoMonoNerdFontMono-Regular.ttf'
[Source-Code-Pro]='Regular/SauceCodeProNerdFontMono-Regular.ttf'
[Terminus]='Regular/TerminessNerdFontMono-Regular.ttf'
[Ubuntu-Mono]='Regular/UbuntuMonoNerdFontMono-Regular.ttf'
[Victor-Mono]='Regular/VictorMonoNerdFontMono-Regular.ttf'
[Anonymous-Pro]='AnonymiceProNerdFont-Regular.ttf'
[DejaVu-Sans-Mono]='DejaVuSansMNerdFont-Regular.ttf'
[Fantasque-Sans-Mono]='FantasqueSansMNerdFont-Regular.ttf'
[Fira-Code]='FiraCodeNerdFont-Regular.ttf'
[Fira-Mono]='FiraMonoNerdFont-Regular.otf'
[Go-Mono]='GoMonoNerdFont-Regular.ttf'
[Hack]='HackNerdFont-Regular.ttf'
[Hermit]='HurmitNerdFont-Regular.otf'
[Inconsolata]='InconsolataNerdFont-Regular.ttf'
[Iosevka]='IosevkaNerdFont-Regular.ttf'
[Liberation-Mono]='LiterationMonoNerdFont-Regular.ttf'
[Meslo]='MesloLGLNerdFont-Regular.ttf'
[Monofur]='MonofurNerdFont-Regular.ttf'
[Monoid]='MonoidNerdFont-Regular.ttf'
[OpenDyslexic]='OpenDyslexicMNerdFont-Regular.otf'
[Roboto-Mono]='RobotoMonoNerdFont-Regular.ttf'
[Source-Code-Pro]='SauceCodeProNerdFont-Regular.ttf'
[Terminus]='TerminessNerdFont-Regular.ttf'
[Ubuntu-Mono]='UbuntuMonoNerdFont-Regular.ttf'
[Victor-Mono]='VictorMonoNerdFont-Regular.ttf'
)

# Starting log message