Shuding shares a full agent prompt that shrank Iosevka from 706KB to 17.6KB
shuding · x · 2026-10-30
shuding shares a complete, reusable prompt that tells a coding agent to shrink a site's web fonts without changing rendering — his table shows Iosevka cut from 706.2KB to 17.6KB and Inter from 337.5KB to 47.8KB.
Key design of the prompt:
- Measure first: per-file size, glyph counts, variable axes, OpenType features, hinting, per-page font bytes and preloads.
- Subset to actual usage: site characters + Latin-1/Latin Extended-A, keep CJK on system fonts, clamp variable axes to used ranges, drop unused features and hinting.
- Split into two files: a small preloaded core (ASCII + common punctuation) and an extended file behind unicode-range that only downloads when needed.
- Pitfalls: generated fallback faces can render extended glyphs early; OFL Reserved Font Names must be renamed after subsetting; font tools have quirks.
- Verification: build a baseline, pixel-diff pages with code/italics/accents/CJK, treat any visual change as a regression, and report before/after bytes and how to rerun the script.
Related event: Vercel Engineer Shares Full Prompt for AI Agent-Driven Web Font Compression(3 posts)→
More from coding & agent
- The eternal eval debugging meme: ask the vendor if it's data or harness, it's data — dejavucoder · 2026-10-30
- GitHub Copilot Fusion scores 60 vs Claude Code's 62 — at half the cost per task — rohanpaul_ai · 2026-10-30
- Assigning an AI Agent One Job: Check Drafts Against the Brief, Cut Revisions — Aiden_Tech_Ai · 2026-10-30
- Dev builds an MCP that compiles agent memory to cut token usage in coding agents — MinniLabs · 2026-10-30
- DejaVu pools your Claude and ChatGPT accounts; when one hits its limit the next continues the chat — Aware_Abroad6657 · 2026-10-30
- brainctl 2.9.1 ships: agent long-term memory in one SQLite file, stale answers 100% to 0% — R4nsack · 2026-10-30