From ab8b887889cad0268f7a30202778db848ecee697 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Wed, 2 Sep 2026 21:59:16 +0200 Subject: [PATCH] fix: a page set in Arial is not rendered in the fallback serif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Import maps a document's Arial to Liberation Sans (screenFontName) and the model keeps it under that name, but only 'Arial' had an @font-face — so on a machine without Liberation Sans installed every such run fell to the browser's default serif. The bundled TTFs are now declared under their own family too, as Liberation Serif already was. Measured against LibreOffice on a 28-page fixture: its cover lines came out 7-16% narrow, 54 reports to 44. --- src/styles/global.css | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/styles/global.css b/src/styles/global.css index ed1928d..9c46684 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -40,6 +40,38 @@ src: url('../assets/fonts/LiberationSerif-BoldItalic.ttf') format('truetype'); } +/* Liberation Sans under its own name too: import maps a document's Arial to it + (screenFontName), so a run carries the bare family and a machine without the + font installed would set an Arial page in the fallback serif. */ +@font-face { + font-family: 'Liberation Sans'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('../assets/fonts/LiberationSans-Regular.ttf') format('truetype'); +} +@font-face { + font-family: 'Liberation Sans'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url('../assets/fonts/LiberationSans-Bold.ttf') format('truetype'); +} +@font-face { + font-family: 'Liberation Sans'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url('../assets/fonts/LiberationSans-Italic.ttf') format('truetype'); +} +@font-face { + font-family: 'Liberation Sans'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url('../assets/fonts/LiberationSans-BoldItalic.ttf') format('truetype'); +} + /* Bullet-marker symbols Liberation Serif lacks (❖ ➢ ⇨ ✓ ▸ ◆), subset from DejaVu Sans so markers render compact and identical on every platform. First in the ::marker/picker stacks; per-glyph fallback keeps all other chars in the text