hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/tools/subset-ttf.rv
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-10 15:57:52 +0200
committerhachem <im@hachem.wtf>2026-10-10 15:57:52 +0200
commit88750ed7132c08bcfb24e878c893ef7185c3c0b0 (patch)
tree6274d4918c82ee0c8c9c258ff8d9d3340b0b28e6 /tools/subset-ttf.rv
parentcc8768d33a6ff6cc64306d01679a10c3a1847736 (diff)
chore: rewrite tools in revo
Diffstat (limited to 'tools/subset-ttf.rv')
-rw-r--r--tools/subset-ttf.rv21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/subset-ttf.rv b/tools/subset-ttf.rv
new file mode 100644
index 0000000..e795149
--- /dev/null
+++ b/tools/subset-ttf.rv
@@ -0,0 +1,21 @@
+# trim a ttf down to the printable ascii subset (U+0020..007E) so we only embed
+# since revel doesnt actually render all glyphs, some fonts that lung wanted are
+# nerd fonts because hes a NERD and are HUGE like my PENIS.
+#
+# usage: revo subset-ttf.rv <in.ttf> <out.ttf>
+
+if argv:len() < 3 do
+ panic("usage: subset-ttf.rv <in.ttf> <out.ttf>")
+end
+
+const in_path = argv[1]
+const out_path = argv[2]
+
+match system({
+ "python3", "-m", "fontTools.subset", in_path,
+ "--unicodes=U+0020-007E",
+ "--no-hinting", "--glyph-names",
+ "--output-file=" ~ out_path,
+})
+ | {:ok, _} => print("wrote " ~ out_path)
+ | {:err, error} => panic("subset failed (#{error}), need fonttools: python3 -m pip install fonttools")