From 88750ed7132c08bcfb24e878c893ef7185c3c0b0 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 10 Oct 2026 15:57:52 +0200 Subject: chore: rewrite tools in revo --- tools/subset-ttf.rv | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/subset-ttf.rv (limited to 'tools/subset-ttf.rv') 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 + +if argv:len() < 3 do + panic("usage: subset-ttf.rv ") +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") -- cgit v1.3