mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-20 15:21:30 +02:00
The Google Fonts css2 API answers a modern user agent with one @font-face per script, all sharing a family and weight and separated only by unicode-range. WeasyPrint then shapes a run against one subset file and rasterises it from another: the PDF's text layer read back correctly while the page showed "ΨΗΦΙΑΚΗ ΥΠΗΡΕΣΙΑ" as "N ĂN ĐỀ ẤU NẤGĂNG". Every non-Latin page title in a report was gibberish. Ask the API with a user agent that predates unicode-range and it answers with one whole file per family, weight and style; subset that here with fontTools and save it as woff2. The vendoring script now refuses to write a face whose block still carries a unicode-range, so the split cannot come back unnoticed. 131 files and 3.3 MB become 23 files and 1.2 MB — smaller as well as correct. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AW5pitnosX8LEFEYxH8gFS