From 869556e531813356aa6cc6633615fa9d2517ffd3 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Fri, 7 Aug 2026 22:24:45 +0000 Subject: [PATCH] feat: render Calibri Light with the bundled Carlito MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Word's default theme heading font, so every Word file with a Title or a heading references it. Without a face it dropped to the browser's serif — a serif heading at the wrong width. --- src/lib/styles/styleSheet.ts | 1 + src/styles/global.css | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/lib/styles/styleSheet.ts b/src/lib/styles/styleSheet.ts index f8fe534..58431bf 100644 --- a/src/lib/styles/styleSheet.ts +++ b/src/lib/styles/styleSheet.ts @@ -203,6 +203,7 @@ export function cssFontFamily(name: string): string { export const DEFAULT_SINGLE_LINE_HEIGHT = 1.15; const SINGLE_LINE_HEIGHT: Record = { Calibri: 1.2208, + 'Calibri Light': 1.2208, Carlito: 1.2208, 'Courier New': 1.1333, 'Liberation Mono': 1.1333, diff --git a/src/styles/global.css b/src/styles/global.css index 06e8893..567c295 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -88,6 +88,30 @@ src: local('Calibri Bold Italic'), local('Carlito Bold Italic'), url('../assets/fonts/Carlito-BoldItalic.ttf') format('truetype'); } +/* Calibri Light → Carlito. Word's default theme heading font; Carlito has no light + cut, so LibreOffice renders it with the regular one too. */ +@font-face { + font-family: 'Calibri Light'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Calibri Light'), local('Carlito'), url('../assets/fonts/Carlito-Regular.ttf') format('truetype'); +} +@font-face { + font-family: 'Calibri Light'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: local('Calibri Light'), local('Carlito Bold'), url('../assets/fonts/Carlito-Bold.ttf') format('truetype'); +} +@font-face { + font-family: 'Calibri Light'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: local('Calibri Light Italic'), local('Carlito Italic'), url('../assets/fonts/Carlito-Italic.ttf') format('truetype'); +} + /* Arial → Liberation Sans */ @font-face { font-family: 'Arial';