Web fonts: fonts from your own server
PerformanceWhy fonts from third-party servers are a legal risk in Germany, which format and how many weights you need, and how the text stays visible until the font arrives.
10 min read
By Timo Wessels Published
A web font is a file that has to be loaded like an image. How it is embedded has consequences for three things: data protection, load time and what visitors see before the font has arrived.
The short answer: serve the fonts from your own server, only as WOFF2, in as few styles as possible, and with font-display: swap and a fitting fallback font. The most important part is your own server, not because of speed but because of a court ruling.
The most important points first:
- A web font is a font file that has to be loaded like an image.
- Serve it from your own server, only as WOFF2, in as few styles as possible, with
font-display: swapand a fitting fallback font. - Your own server is the most important part, not because of speed but because of a court ruling.
Four questions for every font
Fonts do not appear in the visible part of the website. Their embedding stands in CSS files, in a theme or in a plugin and therefore often goes unnoticed for years. According to the Web Almanac 2025, 88 percent of websites use web fonts. Ask each of them four questions:
- Where does it come from? From your own server or a foreign one?
- How much does it weigh in total, across all styles?
- In which format is it?
- What happens until it arrives? Does the text stay visible or disappear briefly?
The legal side: fonts from a foreign server
When fonts are loaded from a foreign server, the visitor’s browser opens a connection there when the page is called. The best-known case is Google Fonts. In its frequently asked questions Google names what arrives: the IP address, the requested address and the HTTP headers. The headers include the browser identification and the referring page. Google also writes that it does not use the collected information for profiles or targeted advertising.
IP addresses are personal data. The European Court of Justice decided this on 19 October 2016 in the Breyer case (C-582/14) for dynamic IP addresses: it is enough that the operator could have the person identified with the help of third parties.
The ruling of the Regional Court of Munich I of 20 January 2022 (case no. 3 O 17493/20) builds on that. A website had loaded Google Fonts from the Google server without consent. The court ordered the operator to stop and to pay 100 euros in damages. The reasoning is the core: a legitimate interest under Art. 6(1)(f) GDPR is ruled out, because Google Fonts can also be used without a connection to Google servers being made and the IP address being transmitted. It is the decision of a regional court and not of a supreme court. But the reasoning hits every website that loads fonts from foreign servers without need.
The good news: with self-served fonts no IP address goes to Google any more when the font is loaded. This is one of the few points where a technical change resolves a legal question instead of managing it. According to the Web Almanac 2025, about 34 percent of websites now serve only their own fonts. Google Fonts is still embedded on 54 percent of desktop and 47 percent of mobile websites.
Speed: no automatic win
A foreign font source needs additional connections. With Google there are two, to fonts.googleapis.com for the CSS and to fonts.gstatic.com for the files. Self-served fonts save these connections.
The earlier advantage of the central service is gone: a visitor used to load a popular font once and use it on all websites. Chrome has separated its cache by website since version 86 (2020). Google itself writes in its frequently asked questions that caching across websites is no longer true.
Honestly, self-serving is still not automatically faster. web.dev points out that the Web Almanac even measured faster rendering for pages with fonts from third-party providers. web.dev advises checking before the switch whether your own site is delivered through a CDN and HTTP/2. A CDN is a network of servers that delivers files from a place near the visitor. The decisive argument in Germany is the legal one. Speed is a bonus if the server is right.
The format: WOFF2
Here the answer is clear. According to web.dev, WOFF2 compresses 30 percent better than WOFF and has the widest browser support. Delivering older formats such as TTF, EOT or WOFF in addition only brings longer CSS rules and the risk of double downloads. That is my assessment.
On the web this has largely arrived: according to the Web Almanac 2025, WOFF2 accounts for about 65 percent of font requests, the older WOFF still for 16 percent. If you download a font as TTF, convert it before building it in.
The extent: styles and characters
Every font family in every style is a file of its own. Three families with four styles each are twelve files. The median mobile home page loads, according to the Web Almanac 2025, 122 KB of fonts.
Fewer styles. Most websites get by with very few: Regular and Bold, italic only if it really occurs. A common mistake: the embedding requests all weights from 100 to 900, and two are used. The browser loads what was requested.
Fewer characters. A font often contains Cyrillic, Greek and Vietnamese characters that a German website never needs. A subsetting tool restricts the file to what is needed. That means it cuts away all characters you do not need. The Google Fonts interface has the parameter text= for this, which according to Google can shrink the file by up to 90 percent. That makes sense for logos and short headings with known text.
Variable fonts. A variable font contains all weights in one file. In a Monotype test, 48 individual files became one, 88 percent smaller. web.dev qualifies: whoever uses only a single style gains nothing from it, because the variable file is larger than a single style. According to the Web Almanac 2025, about 4 in 10 websites use at least one variable font.
What happens while loading
Between the moment the text is there and the moment the font arrives, the browser must decide what to show. You control this decision with font-display.
Without a setting the browser decides. web.dev describes: Chromium browsers and Firefox hide the text for up to 3 seconds if the web font has not loaded. Safari hides it indefinitely. On a slow connection the visitor stares at an empty area although the text has long been loaded.
With font-display: swap the text appears at once in a fallback font and is swapped as soon as the web font is there. That is almost always the right choice. According to the Web Almanac 2025, about half of pages (around 50 percent) set swap:
@font-face {
font-family: "Onest";
src: url("/fonts/onest-regular.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}
The price of swap: if the fallback font and the web font run at different widths, the lines break differently at the swap, and the page shifts. Three countermeasures:
- Match the fallback font. With
size-adjustandascent-overridein a@font-faceof its own for the fallback font, it can be scaled so that the swap is hardly noticeable. - Preload the critical files so that they are there earlier. The
crossoriginis mandatory here, even if the file comes from your own server:
<link rel="preload" href="/fonts/onest-regular.woff2" as="font" type="font/woff2" crossorigin>
font-display: optional, if stability is more important than the font on the first visit. If it does not arrive at once, the fallback font stays.
Preloading belongs only on the one or two files needed for the visible area. Whoever preloads everything has gained nothing. That is my experience.
And the fastest solution of all: a system font. It is already on the device, and the text is there at once. If the font is not decisive for the brand, that is a serious option, for example for body text, while the brand is carried by the headings.
How to check it yourself
The Network tab. Open the developer tools (F12), Network tab, filter “Font”, reload the page. You see every font file with origin and size. Three questions for the list:
- Is
fonts.gstatic.comorfonts.googleapis.comanywhere? - How many files are there?
- What is the sum?
The quick source test. Ctrl+U, then Ctrl+F and search for fonts.googleapis.com. A hit is a finding. But: a plugin or theme can also request the font from a CSS file loaded afterwards. Then it does not stand in the source but shows up in the Network tab. The Network tab is the more reliable check.
The throttling test. Set a slow connection in the Network tab and reload. If the text appears only after a while, font-display: swap is missing. If it appears and the page shifts afterwards, you see the swap effect.
What you can do
- Bring the fonts onto your own server. By hand: download the files as WOFF2, put them in a folder in the project, remove the foreign embedding, create one
@font-facerule per style with a matchingfont-weightandfont-style, and give a fallback font in the font list. In WordPress from version 6.5 the font library in the editor does this: whoever installs a Google font there gets the file on their own server, stored under/wp-content/uploads/fonts. - Add
font-display: swapin all@font-facerules. - Reduce the styles to those actually used.
- Preload the one or two critical files, with
crossorigin. - Check again after every plugin or theme change. Some bring fonts of their own and load them again from foreign servers, even if yours were long switched over. That is the most common reason a fixed problem comes back. That is my experience.
And if you are just rebuilding: decide the font question before the layout, not after. Dropping styles afterwards means touching the design.
Sources
- Regional Court of Munich I, Final judgement of 20.01.2022, case no. 3 O 17493/20 — injunction, 100 euros damages, no legitimate interest because Google Fonts can be used without a connection to Google: gesetze-bayern.de(external site: gesetze-bayern.de)
- dejure.org, CJEU, judgement of 19.10.2016, C-582/14 (Breyer) — dynamic IP addresses as personal data: dejure.org(external site: dejure.org)
- Google Fonts, Frequently asked questions — data transmitted on retrieval, no profiles, no more caching across websites: fonts.google.com(external site: fonts.google.com)
- Chrome for Developers, Gaining security and privacy by partitioning the cache — separated cache since Chrome 86: developer.chrome.com(external site: developer.chrome.com)
- web.dev, Best practices for fonts — self-serving not automatically faster, two Google addresses, WOFF2 30 percent better than WOFF, block period,
size-adjust: web.dev(external site: web.dev) - HTTP Archive, Web Almanac 2025: Fonts — 88 percent with web fonts, Google Fonts 54 and 47 percent, 34 percent only own fonts, 65 percent WOFF2, about half with
swap, about 4 in 10 with variable fonts: almanac.httparchive.org(external site: almanac.httparchive.org) - HTTP Archive, Web Almanac 2025: Page Weight — 122 KB of fonts on the median mobile home page: almanac.httparchive.org(external site: almanac.httparchive.org)
- Google Fonts, CSS API v2 — parameter
text=up to 90 percent smaller,display=swap: developers.google.com(external site: developers.google.com) - web.dev, Introduction to variable fonts on the web — 48 files in one, 88 percent smaller: web.dev(external site: web.dev)
- MDN, font-display — block, swap and failure period of the values: developer.mozilla.org(external site: developer.mozilla.org)
- Chrome for Developers, Ensure text remains visible during webfont load — invisible text while loading: developer.chrome.com(external site: developer.chrome.com)
- web.dev, CSS size-adjust for @font-face — matching the fallback font against shifts: web.dev(external site: web.dev)
- MDN,
rel=preload—crossoriginfor fonts even from your own server: developer.mozilla.org(external site: developer.mozilla.org) - WordPress Core, New Feature: Font Library — the font library since WordPress 6.5: make.wordpress.org(external site: make.wordpress.org)
- WordPress Developer Blog, How to register custom font collections for the Font Library — storage under
/wp-content/uploads/fonts: developer.wordpress.org(external site: developer.wordpress.org) - Own practice — checking after plugin and theme changes, preloading only one or two files, deciding the font question before the layout.