Skip to content

Commit

Permalink
feat: update to Iosevka v29.1.0, add naming overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Apr 6, 2024
1 parent 37b8ff7 commit 615cc52
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 38 deletions.
23 changes: 17 additions & 6 deletions RyanMono.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
[buildPlans.RyanMono]
family = "Ryan Mono"
spacing = "normal"
serifs = "sans"
noCvSs = false
family = "Ryan Mono"
spacing = "normal"
serifs = "sans"
noCvSs = false
exportGlyphNames = true

[buildPlans.RyanMono.variants]
inherits = "ss05"

[buildPlans.RyanMono.widths.Normal]
shape = 600
menu = 5
css = "normal"
menu = 5
css = "normal"

[buildPlans.RyanMono.namingOverride]
version = "%%version%%"
copyright = "Copyright 2015-{{currentYear}}, Renzhi Li (aka. Belleve Invis, belleve@typeof.net). Copyright 2024-{{currentYear}}, Ryan Cao (hello@ryanccn.dev)."
manufacturer = "Ryan Cao"
designer = "Belleve Invis"
description = "Ryan's homemade Iosevka build."
urlVendor = "https://github.com/ryanccn/ryan-mono"
urlDesigner = "https://typeof.net/Iosevka/"
licence = "This font software is licenced under the SIL Open Font Licence, Version 1.1. This licence is available with a FAQ at: http://scripts.sil.org/OFL. This font software is distributed on an 'AS IS' basis, without warranties or conditions of any kind, either express or implied. See the SIL Open Font licence for the specific language, permissions and limitations governing your use of this font software."
licenceURL = "https://openfontlicense.org/"
23 changes: 17 additions & 6 deletions RyanTerm.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
[buildPlans.RyanTerm]
family = "Ryan Term"
spacing = "term"
serifs = "sans"
noCvSs = false
family = "Ryan Term"
spacing = "term"
serifs = "sans"
noCvSs = false
exportGlyphNames = true

[buildPlans.RyanTerm.variants]
inherits = "ss05"

[buildPlans.RyanTerm.widths.Normal]
shape = 600
menu = 5
css = "normal"
menu = 5
css = "normal"

[buildPlans.RyanTerm.namingOverride]
version = "%%version%%"
copyright = "Copyright 2015-{{currentYear}}, Renzhi Li (aka. Belleve Invis, belleve@typeof.net). Copyright 2024-{{currentYear}}, Ryan Cao (hello@ryanccn.dev)."
manufacturer = "Ryan Cao"
designer = "Belleve Invis"
description = "Ryan's homemade Iosevka build."
urlVendor = "https://github.com/ryanccn/ryan-mono"
urlDesigner = "https://typeof.net/Iosevka/"
licence = "This font software is licenced under the SIL Open Font Licence, Version 1.1. This licence is available with a FAQ at: http://scripts.sil.org/OFL. This font software is distributed on an 'AS IS' basis, without warranties or conditions of any kind, either express or implied. See the SIL Open Font licence for the specific language, permissions and limitations governing your use of this font software."
licenceURL = "https://openfontlicense.org/"
60 changes: 34 additions & 26 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ cyan() {
printf '\033[36m%s\033[39m' "$@"
}

iosevka_version="v29.0.1"
nerd_fonts_version="v3.1.1"
iosevka_version="v29.1.0"
nerd_fonts_version="v3.2.0"
font_families=("RyanMono" "RyanTerm")

check_dependencies() {
Expand All @@ -46,9 +46,11 @@ check_dependencies() {
check_dependencies \
printf echo rm mkdir git \
node npm find xargs curl \
unzip date zip tar cp
unzip date zip tar cp sed

echo "$(bold "ryan-mono $(date +%Y.%m.%d)")"
ryan_mono_version=$(date +%Y.%m.%d)

echo "$(bold "ryan-mono $ryan_mono_version")"

echo -e "$(cyan "Iosevka")\t\t$iosevka_version"
echo -e "$(cyan "Nerd Fonts")\t$nerd_fonts_version"
Expand All @@ -62,38 +64,48 @@ command -v sysctl &> /dev/null && cpus="$(sysctl -n hw.physicalcpu)" && cpus_sou
echo -e "$(cyan "Concurrency")\t$cpus $(dim "($cpus_source)")"
echo

rm -rf dist
# rm -rf dist
rm -rf work && mkdir -p work dist
pushd work # => work/

git clone --depth 1 --branch "$iosevka_version" https://github.com/be5invis/Iosevka.git _iosevka

pushd _iosevka # => work/_iosevka
for patch in ../../patches/*.patch; do
patch_name="$(basename "$patch")"
git apply "$patch"
git add .
git commit -m "apply patch $patch_name"
done

npm ci

popd # => work/

curl -fsSL -o FontPatcher.zip \
"https://github.com/ryanoasis/nerd-fonts/releases/download/$nerd_fonts_version/FontPatcher.zip"
unzip FontPatcher.zip -d _fontpatcher
rm FontPatcher.zip

for font_family in "${font_families[@]}"; do
echo "$(green "$(bold "Building $font_family")")"

rm -rf work && mkdir -p work
pushd work

git clone --depth 1 --branch "$iosevka_version" https://github.com/be5invis/Iosevka.git _iosevka
cp "../$font_family.toml" _iosevka/private-build-plans.toml
pushd _iosevka # => work/_iosevka
cp "../../$font_family.toml" "private-build-plans.toml"
sed -i "s/%%version%%/$ryan_mono_version/g" "private-build-plans.toml"

pushd _iosevka
npm ci
npm run build -- "ttf::$font_family"
popd
popd # => work/

mkdir -p "$font_family"
cp _iosevka/dist/"$font_family"/TTF/* "$font_family"

curl -fsSL -o FontPatcher.zip \
"https://github.com/ryanoasis/nerd-fonts/releases/download/$nerd_fonts_version/FontPatcher.zip"
unzip FontPatcher.zip -d _fontpatcher
rm FontPatcher.zip

mkdir -p "${font_family}NerdFont"
find "$font_family" -name '*.ttf' -print0 | xargs -0 --max-args=1 --max-procs="$cpus" \
fontforge -script _fontpatcher/font-patcher --quiet --complete --outputdir "${font_family}NerdFont"

popd
mkdir -p dist

pushd work
cp ../LICENSE "$font_family"
cp ../LICENSE "${font_family}NerdFont"

zip -r -9 ../dist/"$font_family.zip" "$font_family"/*
tar --gzip -cvf ../dist/"$font_family.tar.gz" "$font_family"/*
Expand All @@ -102,8 +114,4 @@ for font_family in "${font_families[@]}"; do
zip -r -9 ../dist/"${font_family}NerdFont.zip" "${font_family}NerdFont"/*
tar --gzip -cvf ../dist/"${font_family}NerdFont.tar.gz" "${font_family}NerdFont"/*
tar --xz -cvf ../dist/"${font_family}NerdFont.tar.xz" "${font_family}NerdFont"/*

popd

rm -rf work
done
28 changes: 28 additions & 0 deletions patches/0001-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 36b1c056f544e5b87f835a92e0c97e0adb732f5b Mon Sep 17 00:00:00 2001
From: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Date: Sat, 6 Apr 2024 14:14:03 +0800
Subject: [PATCH] a

---
packages/font/src/naming/index.mjs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/font/src/naming/index.mjs b/packages/font/src/naming/index.mjs
index 161809f..f37bf0f 100644
--- a/packages/font/src/naming/index.mjs
+++ b/packages/font/src/naming/index.mjs
@@ -132,9 +132,9 @@ function setVersion(font, naming) {
if (naming.version) {
// Trim the "Version " prefix if it exists
const versionString = naming.version.trim().replace(/^Version\s+/i, "");
- const ver = semver.parse(versionString);
+ const ver = semver.parse(versionString.replace(/\.0+/g, '.'));
if (!ver) throw new Error(`Version string ${naming.version} does not follow semver format`);
- if (ver.minor > 99 || ver.patch > 99) throw new RangeError("Version number overflow");
+ // if (ver.minor > 99 || ver.patch > 99) throw new RangeError("Version number overflow");

// Set Name entry
nameFont(font, Ot.Name.NameID.VersionString, `Version ${versionString}`);
--
2.44.0

2 changes: 2 additions & 0 deletions taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[formatting]
align_entries = true

0 comments on commit 615cc52

Please sign in to comment.