| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import { Figtree, Fraunces, Noto_Serif_SC } 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, and its optical-size
- * axis draws each size as designed: crisp, high-contrast cuts for the big
- * headline, sturdier ones for card titles. (Without it every size is drawn
- * from the 9 pt master.) About 120 KB, fetched after the first paint.
- */
- export const fontDisplay = Fraunces({
- subsets: ["latin"],
- axes: ["SOFT", "opsz"],
- variable: "--ff-display",
- display: "swap",
- // Loaded after the first paint by <FontLoader />.
- preload: false,
- });
- /**
- * Chinese display: Noto Serif SC (思源宋体), the Han companion to Fraunces in
- * headings. Google cuts it into about a hundred slices by unicode-range, so a
- * page downloads only the slices holding the characters it shows; English
- * pages show none and download nothing. Chinese body text uses the system's
- * sans (see --font-sans).
- */
- export const fontDisplayZh = Noto_Serif_SC({
- weight: "600",
- variable: "--ff-display-zh",
- display: "swap",
- preload: false,
- adjustFontFallback: false,
- });
- /** Italic Fraunces cut to the four glyphs of the original headline name. The
- * hero name is now Han, so this only remains as a Latin fallback in --font-name. */
- 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 <FontLoader /> 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]}`,
- ];
|