import localFont from "next/font/local"; // --------------------------------------------------------------------------- // The four faces, vendored. NO NETWORK at build or at run time: the brand slice // hit fonts.gstatic failures, and this is a tool on a machine that is often // offline from the services it talks to. // // Archivo, Plex Sans and Plex Mono Regular/Bold are REFERENCED from // report-to-video/fonts/ rather than copied: that directory is already the // brand's vendored set (unmodified from google/fonts, OFL.txt beside them), the // renderer draws the same videos with them, and one copy cannot drift from the // other. Nothing new goes INTO that directory, though: its fonts.conf hands the // whole directory to the renderer's own children, so a face added there would // change what a video can render with. The two faces only the app needs -- // Source Serif 4 (the reader) and Plex Mono Medium -- live in umtool/fonts/, // each with its OFL.txt, from the families' own releases (adobe-fonts/ // source-serif 4.005R, IBM/plex @ibm/plex-mono@2.5.0). // // TTF, not woff2: Plex carries a Reserved Font Name and ships unmodified here // (report-to-video/fonts/gen-face-metrics.py says why), and on a local tool the // transfer size is not worth a conversion step to reason about. // // Each sets a CSS variable on ; app/globals.css builds --f-ui, --f-mono, // --f-reader and --f-display on them, and Tailwind's font-sans / font-mono / // font-serif / font-display read those. // --------------------------------------------------------------------------- export const archivo = localFont({ src: [{ path: "../report-to-video/fonts/Archivo[wdth,wght].ttf", weight: "100 900", style: "normal" }], variable: "--font-archivo", display: "swap", // Only titles use it, and only at expanded width. preload: false, declarations: [{ prop: "font-stretch", value: "62% 125%" }], }); export const plexSans = localFont({ src: [{ path: "../report-to-video/fonts/IBMPlexSans[wdth,wght].ttf", weight: "100 700", style: "normal" }], variable: "--font-plex-sans", display: "swap", declarations: [{ prop: "font-stretch", value: "75% 100%" }], }); export const plexMono = localFont({ src: [ { path: "../report-to-video/fonts/IBMPlexMono-Regular.ttf", weight: "400", style: "normal" }, { path: "../fonts/ibm-plex-mono/IBMPlexMono-Medium.ttf", weight: "500", style: "normal" }, { path: "../report-to-video/fonts/IBMPlexMono-Bold.ttf", weight: "700", style: "normal" }, ], variable: "--font-plex-mono", display: "swap", }); export const sourceSerif = localFont({ src: [ { path: "../fonts/source-serif-4/SourceSerif4Variable-Roman.ttf", weight: "200 900", style: "normal" }, { path: "../fonts/source-serif-4/SourceSerif4Variable-Italic.ttf", weight: "200 900", style: "italic" }, ], variable: "--font-source-serif", display: "swap", // The reader appears on a minority of pages; do not make every page fetch it. preload: false, adjustFontFallback: "Times New Roman", }); /** Every face's variable, for . */ export const fontVariables = [archivo, plexSans, plexMono, sourceSerif].map((f) => f.variable).join(" ");