dsh-font-subset

Cut a font down to the characters a page actually uses. `font_coverage` reports which characters a font is missing, before the cut turns them into tofu boxes; `font_subset` then emits a woff2 (or woff or ttf) containing only what the page needs. Measured on simhei.ttf - 9.3 MB to 3.5 KB for 24 distinct characters. Characters can be given directly, read from a file, or collected from an html/vue/js/ts/css tree.

Workflow AutomationAGPL-3.0☆ 0

Overview

Cut a font down to the characters a page actually uses. `font_coverage` reports which characters a font is missing, before the cut turns them into tofu boxes; `font_subset` then emits a woff2 (or woff or ttf) containing only what the page needs. Measured on simhei.ttf - 9.3 MB to 3.5 KB for 24 distinct characters. Characters can be given directly, read from a file, or collected from an html/vue/js/ts/css tree.

Installation

Install from GitHub

dsh plugin --profile web add github:Lee2277-t/dsh-font-subset

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.