import { Figtree, Fraunces } from "next/font/google"; import localFont from "next/font/local"; /** * Text and interface: SF Pro on Apple devices (nothing to download), Figtree, * a friendly geometric sans, everywhere else. Not preloaded, so Apple devices * never fetch it. */ export const fontText = Figtree({ subsets: ["latin"], variable: "--ff-text", display: "swap", preload: false, }); /** * Display: Fraunces, a soft variable serif. Its SOFT axis rounds the letters, * so the headline can melt like liquid under the cursor. The optical-size * axis is left out to keep the file small (about 60 KB). */ export const fontDisplay = Fraunces({ subsets: ["latin"], axes: ["SOFT"], variable: "--ff-display", display: "swap", // Loaded after the first paint by . preload: false, }); /** The italic "Eric" in the headline: Fraunces Italic subset to four glyphs (4 KB). */ export const fontName = localFont({ src: "../assets/fonts/fraunces-italic-eric.woff2", style: "italic", weight: "100 900", variable: "--ff-name", display: "swap", preload: false, adjustFontFallback: "Times New Roman", }); /** What asks the browser to load once the page has painted. */ export const deferredFaces = [ `600 1em ${fontDisplay.style.fontFamily.split(",")[0]}`, `italic 600 1em ${fontName.style.fontFamily.split(",")[0]}`, ];