Skip to content

Commit 615cc52

Browse files
committed
feat: update to Iosevka v29.1.0, add naming overrides
1 parent 37b8ff7 commit 615cc52

File tree

5 files changed

+98
-38
lines changed

5 files changed

+98
-38
lines changed

RyanMono.toml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
[buildPlans.RyanMono]
2-
family = "Ryan Mono"
3-
spacing = "normal"
4-
serifs = "sans"
5-
noCvSs = false
2+
family = "Ryan Mono"
3+
spacing = "normal"
4+
serifs = "sans"
5+
noCvSs = false
66
exportGlyphNames = true
77

88
[buildPlans.RyanMono.variants]
99
inherits = "ss05"
1010

1111
[buildPlans.RyanMono.widths.Normal]
1212
shape = 600
13-
menu = 5
14-
css = "normal"
13+
menu = 5
14+
css = "normal"
15+
16+
[buildPlans.RyanMono.namingOverride]
17+
version = "%%version%%"
18+
copyright = "Copyright 2015-{{currentYear}}, Renzhi Li (aka. Belleve Invis, belleve@typeof.net). Copyright 2024-{{currentYear}}, Ryan Cao (hello@ryanccn.dev)."
19+
manufacturer = "Ryan Cao"
20+
designer = "Belleve Invis"
21+
description = "Ryan's homemade Iosevka build."
22+
urlVendor = "https://github.com/ryanccn/ryan-mono"
23+
urlDesigner = "https://typeof.net/Iosevka/"
24+
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."
25+
licenceURL = "https://openfontlicense.org/"

RyanTerm.toml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
[buildPlans.RyanTerm]
2-
family = "Ryan Term"
3-
spacing = "term"
4-
serifs = "sans"
5-
noCvSs = false
2+
family = "Ryan Term"
3+
spacing = "term"
4+
serifs = "sans"
5+
noCvSs = false
66
exportGlyphNames = true
77

88
[buildPlans.RyanTerm.variants]
99
inherits = "ss05"
1010

1111
[buildPlans.RyanTerm.widths.Normal]
1212
shape = 600
13-
menu = 5
14-
css = "normal"
13+
menu = 5
14+
css = "normal"
15+
16+
[buildPlans.RyanTerm.namingOverride]
17+
version = "%%version%%"
18+
copyright = "Copyright 2015-{{currentYear}}, Renzhi Li (aka. Belleve Invis, belleve@typeof.net). Copyright 2024-{{currentYear}}, Ryan Cao (hello@ryanccn.dev)."
19+
manufacturer = "Ryan Cao"
20+
designer = "Belleve Invis"
21+
description = "Ryan's homemade Iosevka build."
22+
urlVendor = "https://github.com/ryanccn/ryan-mono"
23+
urlDesigner = "https://typeof.net/Iosevka/"
24+
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."
25+
licenceURL = "https://openfontlicense.org/"

build.sh

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ cyan() {
3030
printf '\033[36m%s\033[39m' "$@"
3131
}
3232

33-
iosevka_version="v29.0.1"
34-
nerd_fonts_version="v3.1.1"
33+
iosevka_version="v29.1.0"
34+
nerd_fonts_version="v3.2.0"
3535
font_families=("RyanMono" "RyanTerm")
3636

3737
check_dependencies() {
@@ -46,9 +46,11 @@ check_dependencies() {
4646
check_dependencies \
4747
printf echo rm mkdir git \
4848
node npm find xargs curl \
49-
unzip date zip tar cp
49+
unzip date zip tar cp sed
5050

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

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

65-
rm -rf dist
67+
# rm -rf dist
68+
rm -rf work && mkdir -p work dist
69+
pushd work # => work/
70+
71+
git clone --depth 1 --branch "$iosevka_version" https://github.com/be5invis/Iosevka.git _iosevka
72+
73+
pushd _iosevka # => work/_iosevka
74+
for patch in ../../patches/*.patch; do
75+
patch_name="$(basename "$patch")"
76+
git apply "$patch"
77+
git add .
78+
git commit -m "apply patch $patch_name"
79+
done
80+
81+
npm ci
82+
83+
popd # => work/
84+
85+
curl -fsSL -o FontPatcher.zip \
86+
"https://github.com/ryanoasis/nerd-fonts/releases/download/$nerd_fonts_version/FontPatcher.zip"
87+
unzip FontPatcher.zip -d _fontpatcher
88+
rm FontPatcher.zip
6689

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

70-
rm -rf work && mkdir -p work
71-
pushd work
72-
73-
git clone --depth 1 --branch "$iosevka_version" https://github.com/be5invis/Iosevka.git _iosevka
74-
cp "../$font_family.toml" _iosevka/private-build-plans.toml
93+
pushd _iosevka # => work/_iosevka
94+
cp "../../$font_family.toml" "private-build-plans.toml"
95+
sed -i "s/%%version%%/$ryan_mono_version/g" "private-build-plans.toml"
7596

76-
pushd _iosevka
77-
npm ci
7897
npm run build -- "ttf::$font_family"
79-
popd
98+
popd # => work/
8099

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

84-
curl -fsSL -o FontPatcher.zip \
85-
"https://github.com/ryanoasis/nerd-fonts/releases/download/$nerd_fonts_version/FontPatcher.zip"
86-
unzip FontPatcher.zip -d _fontpatcher
87-
rm FontPatcher.zip
88-
89103
mkdir -p "${font_family}NerdFont"
90104
find "$font_family" -name '*.ttf' -print0 | xargs -0 --max-args=1 --max-procs="$cpus" \
91105
fontforge -script _fontpatcher/font-patcher --quiet --complete --outputdir "${font_family}NerdFont"
92106

93-
popd
94-
mkdir -p dist
95-
96-
pushd work
107+
cp ../LICENSE "$font_family"
108+
cp ../LICENSE "${font_family}NerdFont"
97109

98110
zip -r -9 ../dist/"$font_family.zip" "$font_family"/*
99111
tar --gzip -cvf ../dist/"$font_family.tar.gz" "$font_family"/*
@@ -102,8 +114,4 @@ for font_family in "${font_families[@]}"; do
102114
zip -r -9 ../dist/"${font_family}NerdFont.zip" "${font_family}NerdFont"/*
103115
tar --gzip -cvf ../dist/"${font_family}NerdFont.tar.gz" "${font_family}NerdFont"/*
104116
tar --xz -cvf ../dist/"${font_family}NerdFont.tar.xz" "${font_family}NerdFont"/*
105-
106-
popd
107-
108-
rm -rf work
109117
done

patches/0001-version.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 36b1c056f544e5b87f835a92e0c97e0adb732f5b Mon Sep 17 00:00:00 2001
2+
From: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
3+
Date: Sat, 6 Apr 2024 14:14:03 +0800
4+
Subject: [PATCH] a
5+
6+
---
7+
packages/font/src/naming/index.mjs | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/packages/font/src/naming/index.mjs b/packages/font/src/naming/index.mjs
11+
index 161809f..f37bf0f 100644
12+
--- a/packages/font/src/naming/index.mjs
13+
+++ b/packages/font/src/naming/index.mjs
14+
@@ -132,9 +132,9 @@ function setVersion(font, naming) {
15+
if (naming.version) {
16+
// Trim the "Version " prefix if it exists
17+
const versionString = naming.version.trim().replace(/^Version\s+/i, "");
18+
- const ver = semver.parse(versionString);
19+
+ const ver = semver.parse(versionString.replace(/\.0+/g, '.'));
20+
if (!ver) throw new Error(`Version string ${naming.version} does not follow semver format`);
21+
- if (ver.minor > 99 || ver.patch > 99) throw new RangeError("Version number overflow");
22+
+ // if (ver.minor > 99 || ver.patch > 99) throw new RangeError("Version number overflow");
23+
24+
// Set Name entry
25+
nameFont(font, Ot.Name.NameID.VersionString, `Version ${versionString}`);
26+
--
27+
2.44.0
28+

taplo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[formatting]
2+
align_entries = true

0 commit comments

Comments
 (0)