summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-08-15 14:58:17 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-08-15 14:58:17 +0200
commitd14c9c40af1d43b7db0aeb310a84b4e2704ffec5 (patch)
tree243451baac4fcb3153acb1cdba4852057813f2da
parentb36513004f4ced6d354992fdadb67d1fa14ab154 (diff)
Build minimal fonts
-rw-r--r--.gitignore1
-rwxr-xr-xgen-fonts50
2 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 89f9ac0..2adeaa1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
+fonts/
out/
diff --git a/gen-fonts b/gen-fonts
new file mode 100755
index 0000000..81716ed
--- /dev/null
+++ b/gen-fonts
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+. /usr/share/nvm/init-nvm.sh
+
+make
+mkdir -p fonts
+
+{
+ uni1=`find out -name '*.html' | xargs glyphhanger \
+ --cssSelector=':not(code, pre, kbd, samp)' \
+ --jsdom`
+
+ pyftsubset /usr/share/fonts/WOFF2/Vollkorn-Regular.woff2 \
+ --output-file=fonts/vollkorn-regular.woff2 \
+ --flavor=woff2 \
+ --layout-features-=locl \
+ --unicodes="$uni1" \
+ --no-hinting \
+ --desubroutinize
+ pyftsubset /usr/share/fonts/WOFF2/Vollkorn-Italic.woff2 \
+ --output-file=fonts/vollkorn-italic.woff2 \
+ --flavor=woff2 \
+ --layout-features-=locl \
+ --unicodes="$uni1" \
+ --no-hinting \
+ --desubroutinize
+} &
+
+{
+ uni2=`find out -name '*.html' | xargs glyphhanger \
+ --cssSelector='code, pre, kbd, samp' \
+ --jsdom`
+
+ pyftsubset /usr/share/fonts/iosevka-smooth/woff2-unhinted/iosevka-smooth-regular.woff2 \
+ --output-file=fonts/iosevka-regular.woff2 \
+ --flavor=woff2 \
+ --layout-features-=locl \
+ --unicodes="$uni2" \
+ --no-hinting \
+ --desubroutinize
+ pyftsubset /usr/share/fonts/iosevka-smooth/woff2-unhinted/iosevka-smooth-italic.woff2 \
+ --output-file=fonts/iosevka-italic.woff2 \
+ --flavor=woff2 \
+ --layout-features-=locl \
+ --unicodes="$uni2" \
+ --no-hinting \
+ --desubroutinize
+} &
+
+wait