migrating from Google Fonts
The onlyfonts CDN implements the same css2 URL format as Google Fonts. For fonts in our catalog, migrating is a hostname change.
the change
Before:
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
After:
<link href="https://cdn.onlyfonts.ai/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
The family syntax is identical: weights (wght@400;700), italics (ital,wght@0,400;1,400), variable ranges (wght@300..800), multiple families, and the display parameter all work the same way.
Also update the preconnect hints:
<link rel="preconnect" href="https://cdn.onlyfonts.ai" crossorigin>
(replacing the fonts.googleapis.com and fonts.gstatic.com preconnects — onlyfonts serves CSS and font files from one host.)
why switch
- privacy: no user tracking, no logging of visitor identity. German courts have fined sites for embedding Google Fonts without consent (LG München, 2022) because it transmits visitor IP addresses to Google
- EU data residency: served from Cloudflare’s edge with storage in Western Europe
- same open-source fonts, same format, same performance characteristics
checking font availability
Most Google Fonts families are in the catalog. Search for your font on the catalog — if the font page exists, the CDN serves it. If a family you need is missing, the page for a similar font will suggest alternatives, or contact us.
self-hosting instead
If you’d rather not depend on any CDN, every font page has TTF downloads and the CDN reference documents the direct woff2 file URLs, which you can mirror. The fonts are open-source licensed — see licenses.