From 8b05011a80f8354d27b9885f305daf170a785d61 Mon Sep 17 00:00:00 2001 From: David Wildasin Date: Sun, 24 Mar 2024 17:04:08 -0400 Subject: [PATCH 1/2] 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. --- setup-nerd-fonts.sh | 62 +++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/setup-nerd-fonts.sh b/setup-nerd-fonts.sh index f21ea6c..675d67e 100755 --- a/setup-nerd-fonts.sh +++ b/setup-nerd-fonts.sh @@ -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 From 4b0753c1d9952f4c8873bf21f9d6fbe6157d4867 Mon Sep 17 00:00:00 2001 From: David Wildasin Date: Sun, 24 Mar 2024 17:10:17 -0400 Subject: [PATCH 2/2] Add missing entries for fonts that are already present in the repo. Also adjusted the file names for `Cascadia-Code` as per ee7365e57cee9e21d687d3e2c4d1392899ab1b38. --- .../fonts/{CascadiaCode.ttf => Cascadia-Code.ttf} | Bin .../fonts/{CascadiaCode.txt => Cascadia-Code.txt} | 0 setup-nerd-fonts.sh | 3 +++ 3 files changed, 3 insertions(+) rename app/src/main/assets/fonts/{CascadiaCode.ttf => Cascadia-Code.ttf} (100%) rename app/src/main/assets/fonts/{CascadiaCode.txt => Cascadia-Code.txt} (100%) diff --git a/app/src/main/assets/fonts/CascadiaCode.ttf b/app/src/main/assets/fonts/Cascadia-Code.ttf similarity index 100% rename from app/src/main/assets/fonts/CascadiaCode.ttf rename to app/src/main/assets/fonts/Cascadia-Code.ttf diff --git a/app/src/main/assets/fonts/CascadiaCode.txt b/app/src/main/assets/fonts/Cascadia-Code.txt similarity index 100% rename from app/src/main/assets/fonts/CascadiaCode.txt rename to app/src/main/assets/fonts/Cascadia-Code.txt diff --git a/setup-nerd-fonts.sh b/setup-nerd-fonts.sh index 675d67e..d7a7ee1 100755 --- a/setup-nerd-fonts.sh +++ b/setup-nerd-fonts.sh @@ -27,6 +27,8 @@ getNerdFont() { declare -A fonts=( # [font-name]='path/to/file.ttf' [Anonymous-Pro]='AnonymiceProNerdFont-Regular.ttf' + [Cascadia-Code]='CaskaydiaCoveNerdFont-Regular.ttf' + [D2-Coding]='D2CodingLigatureNerdFont-Regular.ttf' [DejaVu-Sans-Mono]='DejaVuSansMNerdFont-Regular.ttf' [Fantasque-Sans-Mono]='FantasqueSansMNerdFont-Regular.ttf' [Fira-Code]='FiraCodeNerdFont-Regular.ttf' @@ -36,6 +38,7 @@ declare -A fonts=( # [font-name]='path/to/file.ttf' [Hermit]='HurmitNerdFont-Regular.otf' [Inconsolata]='InconsolataNerdFont-Regular.ttf' [Iosevka]='IosevkaNerdFont-Regular.ttf' + [JetBrains-Mono]='JetBrainsMonoNerdFont-Regular.ttf' [Liberation-Mono]='LiterationMonoNerdFont-Regular.ttf' [Meslo]='MesloLGLNerdFont-Regular.ttf' [Monofur]='MonofurNerdFont-Regular.ttf'