next/font downloads and self-hosts Google or local fonts at build time, generates size-adjust fallbacks and removes the render-blocking stylesheet request. Import the font in the layout, pass its className to the html element, and reference the CSS variable in styles. Verify with a throttled trace that text does not shift and that no font request leaves your origin.
The extended brief explains when this works, when it does not, and the trade-offs. Join the waitlist and it unlocks for every tip when sign-in opens; MCP access is the paid part.
The font family, weights and subsets the design uses
How to apply it
Import the font in the layout
Import the font from next/font/google or next/font/local in app/layout.tsx, pass subsets and weights, and assign the returned className to the html element.
Check: The rendered html element carries the generated font class and no link tag points at fonts.googleapis.com.
Reference it through a CSS variable
Set variable to a name such as --font-sans and use that variable in the global stylesheet so components inherit the same family without importing it again.
Check: grep -n 'font-family' app/globals.css shows the variable, and the built CSS contains no external font URL.
Measure the swap
Run a throttled mobile trace with the network cache disabled and record layout shift around the first text paint. Compare it with the previous build.
Check: Lighthouse reports CLS below 0.1 on the typography-heavy template.
Trim weights and subsets
Load only the weights and subsets the design uses, then re-check the font files served. Remove unused families before deploying.
Check: The network panel shows two font files at most for the primary family.
Import fonts with `next/font/google` or `next/font/local` in `app/layout.tsx`, pass the `className` to `<html>`, and expose a `variable` for the stylesheet.
Verify indexing with URL Inspection — URL Inspection shows the indexed version Google holds for one URL: crawl time, selected canonical, status code and blocked resources.
Canonicalize duplicate URLs — Duplicate URLs split signals across protocol, host, slash and parameter variants.
Make JavaScript content crawlable — Google renders JavaScript, but rendering costs time and AI retrieval systems often read raw HTML.