next/font
The Next.js font module, which downloads fonts at build time, serves them from your own domain and sets up fallbacks that avoid layout shift.
In more detail
Visitors never contact Google Fonts, which helps privacy and removes a network hop. It generates a fallback font adjusted with size-adjust and preloads the chosen subsets.
Example
import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });Related terms
- web font — A font file downloaded by the page, declared with @font-face, instead of one already installed on the user's device.
- size-adjust — A CSS @font-face setting that scales a font's glyphs, used to make a fallback font take up the same space as the web font.
- font subset — A cut-down font file containing only the characters for certain languages, such as Latin.
- Cumulative Layout Shift — A Core Web Vitals score measuring how much visible content unexpectedly jumps while a page loads.
Taught in
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture