web font
A font file downloaded by the page, declared with @font-face, instead of one already installed on the user's device.
In more detail
Until the font loads, the browser may show a fallback typeface, changing text width and layout. Visual tests wait for document.fonts.ready before taking screenshots.
Example
In the browser: Font files are usually served in a compressed web format and can be large. Fonts are discovered late, only after CSS is parsed, so important ones are often preloaded.Related terms
- flaky test — A test that sometimes passes and sometimes fails on the same code, because it depends on something it does not control.
- layout shift — Visible content unexpectedly moving position on the page, for example when a font loads or an element resizes.
- typography — The choice and arrangement of fonts, sizes, weights and line spacing to make text readable and show hierarchy.
- font-display — The @font-face setting that controls what text shows while a web font loads: invisible, a fallback font, or the fallback permanently if the font is late.
- preload — A resource hint, <link rel="preload">, that makes the browser download a file needed for the current page right away at high priority.
- 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.
- fallback font — The locally installed font shown until a web font loads, or if it fails.
- flash of unstyled text — The moment when text first appears in a fallback font and then jumps as the web font loads.
Taught in
- Visual Regression Testing: Playwright & Snapshot Differencing — Design Systems & Component Engineering
- HTML Parsing, Tokenization And The Document Object Model (DOM) — Frontend Architecture & Web Platform
- Critical Rendering Path: Preload, Prefetch And Scripts — Frontend Architecture & Web Platform
- Core Web Vitals: Measuring And Optimizing LCP, INP, And CLS — Frontend Architecture & Web Platform
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture