🔤Web Font
Also known as Webfont, @font-face, WOFF2
A font file sent with a web page. Text then shows in that exact font.
Think of it like
It is like taking your own pens to school. You do not need to borrow one.
Example
A shop's site loads its brand font from its own server. On every phone, the headings look just like the printed catalog.
Why it matters
Web fonts let a brand look the same on every device, at the cost of some load time.
Definition
Example code
css
@font-face {
font-family: "Brand Sans";
src: url("/fonts/brand-sans.woff2") format("woff2");
font-display: swap;
}Common mistake
Key takeaways
- 1Sent with the page. Not just fonts on the device.
- 2WOFF2 is the format. Small and widely supported.
- 3Load only what you use. Each file costs time.