mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-21 07:41:28 +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
24 lines
3.3 KiB
CSS
24 lines
3.3 KiB
CSS
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/inter-400.woff2') format('woff2')}
|
|
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/inter-500.woff2') format('woff2')}
|
|
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/inter-600.woff2') format('woff2')}
|
|
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/inter-700.woff2') format('woff2')}
|
|
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/space-grotesk-400.woff2') format('woff2')}
|
|
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/space-grotesk-500.woff2') format('woff2')}
|
|
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/space-grotesk-700.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:italic;font-weight:400;font-display:swap;src:url('fonts/ibm-plex-sans-400-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:italic;font-weight:600;font-display:swap;src:url('fonts/ibm-plex-sans-600-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:italic;font-weight:700;font-display:swap;src:url('fonts/ibm-plex-sans-700-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/ibm-plex-sans-400.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/ibm-plex-sans-600.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/ibm-plex-sans-700.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:400;font-display:swap;src:url('fonts/source-serif-400-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:600;font-display:swap;src:url('fonts/source-serif-600-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:700;font-display:swap;src:url('fonts/source-serif-700-italic.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/source-serif-400.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/source-serif-600.woff2') format('woff2')}
|
|
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/source-serif-700.woff2') format('woff2')}
|
|
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/jetbrains-mono-400.woff2') format('woff2')}
|
|
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/jetbrains-mono-700.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/ibm-plex-mono-400.woff2') format('woff2')}
|
|
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/ibm-plex-mono-600.woff2') format('woff2')}
|