From aeba77f3c0406d24c0bda6d95a3a1d8a460b2d0e Mon Sep 17 00:00:00 2001 From: Yuto Nishida Date: Sun, 9 Aug 2026 17:58:48 -0700 Subject: [PATCH] [papyrus] Self-host terminal fonts, bundled from nix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The terminal font came from the Google Fonts CDN (JetBrains Mono, weights 400/500, no italic — so bold/italic were browser-synthesized). Self-host the terminal fonts instead: a flake `terminalFonts` derivation assembles the RIBBI faces of JetBrains Mono + Iosevka/IosevkaTerm Nerd Font (base + Mono) from nixpkgs; the client buildPhase drops them into Vite's publicDir so they ship in dist/fonts/ and load via @font-face in index.css. JetBrains Mono is dropped from the Google Fonts (Inter, the UI font, stays). The .ttf are generated, not committed (Nerd Font TTFs are ~10 MB each): client/public/fonts/ is gitignored and regenerated for `bun run dev` by scripts/sync-terminal-fonts.sh (invoked from run-dev-instance.sh) and by the Nix build, both from the same `terminalFonts` derivation. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01GBWyw3DyRvvNmgJpFZBsC5 --- experimental/papyrus/.gitignore | 4 + experimental/papyrus/client/index.html | 3 +- experimental/papyrus/client/src/index.css | 86 +++++++++++++++++++ experimental/papyrus/flake.nix | 22 ++++- experimental/papyrus/run-dev-instance.sh | 3 + .../papyrus/scripts/sync-terminal-fonts.sh | 16 ++++ 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100755 experimental/papyrus/scripts/sync-terminal-fonts.sh diff --git a/experimental/papyrus/.gitignore b/experimental/papyrus/.gitignore index 5d3b822..6ab76c3 100644 --- a/experimental/papyrus/.gitignore +++ b/experimental/papyrus/.gitignore @@ -11,6 +11,10 @@ dist/ client/dist/ *.tsbuildinfo +# Terminal fonts, generated from nix (flake `terminalFonts` / scripts/sync-terminal-fonts.sh). +# Bundled into the build; never committed (Nerd Font TTFs are ~10 MB each). +client/public/fonts/ + # Environment .env .env.local diff --git a/experimental/papyrus/client/index.html b/experimental/papyrus/client/index.html index 0d219df..28ce80c 100644 --- a/experimental/papyrus/client/index.html +++ b/experimental/papyrus/client/index.html @@ -7,7 +7,8 @@ papyrus - + +