A corporate identity font determines how the page looks, but it’s one of the last resources the browser discovers. The browser downloads the HTML first, then the CSS; it only requests the font when it realizes it has found text in the CSS that uses it. Until then, the heading is either invisible or drawn in the wrong font. This guide covers hosting, file format, a subset that preserves Turkish characters, font-display, preload and fallback font matching, with code examples, for developers who want to fix LCP and CLS on corporate sites.
How fonts affect performance
Fonts directly affect two metrics. The first is LCP: if the largest element on the first screen is a heading or paragraph and the text is kept invisible until the font arrives, LCP becomes tied to the font download time. The second is CLS: when text is first drawn in the fallback font and then replaced with the web font, the difference in width and line height between the two fonts changes line breaks and the content below shifts. One file, two metrics.
There are two behaviors in how browsers load fonts:
- FOIT (flash of invisible text): Text isn’t drawn until the font arrives. The user sees empty space; LCP is delayed.
- FOUT (flash of unstyled text): Text is drawn immediately in the fallback font and changes when the font arrives. Content appears early, but there’s a risk of shifting.
The goal isn’t to choose one of the two. It’s to download the font file as early and as small as possible and to make the unavoidable swap imperceptible. For an overview alongside the other metrics, see the website speed-up guide.
Comparing hosting options
On corporate sites, fonts are usually served in one of three ways. Make the choice not only on speed but also on licensing and personal data.
| Option | Advantage | Limitation |
|---|---|---|
| Google Fonts CDN | Easy to set up, automatic subsetting and WOFF2 | A connection to an extra domain; the visitor’s IP address goes to a third party |
| Self-hosting | Served over the same connection, full control, caching in your hands | You manage subsetting, updates and headers |
| Commercial font service (e.g. Adobe Fonts) | Licensing is managed through the service | An extra script or CSS request; self-hosting usually not permitted |
In the past, the advantage of a shared CDN was that the user had already downloaded the font on another site. Since current browsers partition the HTTP cache by top-level site (cache partitioning), that advantage is gone. In addition, transferring the visitor’s IP address to a provider abroad is something that needs separate evaluation under KVKK (Turkish data protection law). Together, these two reasons make self-hosting the default choice on most corporate sites. For commercial fonts, check the web license terms on self-hosting, page view counts and domains. The license file is as important as the font file.
WOFF2, variable fonts and subsetting
A single format is enough for the web: WOFF2. It uses Brotli-based compression and is supported by all current browsers. You no longer need to serve TTF, EOT or SVG font fallbacks; we often see these fallbacks still sitting in @font-face in old themes, so clean them up.
Variable font or static files?
A variable font carries axes such as weight in a single file. If four or more weights are used on the site, a single variable file usually means fewer total bytes and fewer requests than four static files. If only two weights are used, two static files may be smaller. Don’t guess, measure: compare the WOFF2 sizes of the two options after generating them with your own subset.
A subset for Turkish
A font file can contain thousands of glyphs. If your site publishes only Turkish and English content, you don’t need Cyrillic, Greek or Vietnamese characters. The trap is this: Turkish letters are spread across two different Unicode blocks. ç, ö, ü are in Latin-1; ğ, ı, İ, ş are in Latin Extended-A. In ready-made packages that select only the “latin” subset, ğ and ş are drawn with the fallback font and the letters in a heading don’t match. This is the font mistake we see most often in the field. You can produce your own subset with pyftsubset from the fonttools package (the brotli Python module is needed for WOFF2 output):
pip install fonttools brotli
pyftsubset CorporateSans-Variable.ttf \
--unicodes="U+0000-00FF,U+011E-011F,U+0130-0131,U+015E-015F,U+2000-206F,U+20AC,U+20BA" \
--layout-features='*' \
--flavor=woff2 \
--output-file=corporatesans-tr.woff2
The U+2000-206F range covers the ’ “ ” marks and dashes used in Turkish typography; U+20BA is the Turkish lira sign and U+20AC the euro sign. --layout-features='*' preserves OpenType features such as ligatures and kerning. After creating the subset, do a visual check with the site’s real content (form labels, menus, table headers); a menu item containing an uppercase “İ” and “Ş” is a good test point.
@font-face {
font-family: "Corporate Sans";
src: url("/fonts/corporatesans-tr.woff2") format("woff2");
font-weight: 300 800; /* the range the variable font supports */
font-style: normal;
font-display: swap;
unicode-range: U+0000-00FF, U+011E-011F, U+0130-0131, U+015E-015F,
U+2000-206F, U+20AC, U+20BA;
}
unicode-range tells the browser which characters this file is needed for; if the page has no characters in this range, the file is never downloaded. On multilingual sites, if you define a separate file and a separate unicode-range per language, each visitor downloads only the glyphs they need.
font-display values
font-display determines what the browser does before and after the font arrives. The behavior is split into two periods: in the “block” period text is drawn invisibly, and in the “swap” period it’s visible in the fallback font and swapped if the font arrives.
| Value | Block period | Swap period | Suitable use |
|---|---|---|---|
| auto | Left to the browser | Left to the browser | Not recommended |
| block | Short (spec suggests ~3 s) | Unlimited | Icon fonts |
| swap | Very short | Unlimited | Brand headings, body text |
| fallback | Very short | Short (~3 s) | Body text, shift-sensitive pages |
| optional | Very short | None | Where CLS is critical and the font is “nice to have” |
With optional, if the font doesn’t arrive in time on the first visit, it isn’t used at all for that page view, but it’s downloaded and cached; it’s used on the next page. This brings CLS to practically zero but compromises brand consistency on the first visit. On corporate sites, the balanced choice is swap for headings and body plus the fallback font matching described below. Swap alone isn’t enough.
Preload and priority
Because the font file is defined inside the CSS, the browser discovers it late. Preload pulls this discovery forward to the moment the HTML is parsed:
<link rel="preload" href="/fonts/corporatesans-tr.woff2"
as="font" type="font/woff2" crossorigin>
The crossorigin attribute is mandatory even if the font is served from the same domain. Because fonts are requested in CORS mode, a preload made without this attribute doesn’t match; the browser downloads the file twice and an unused preload warning appears in the console. That warning is the first place to look in the console. The URL in the preload must be identical, character for character, to the URL in @font-face. Even a version parameter difference creates a separate request.
Limit preload to the one or two files used on the first screen. If font files come from a separate domain, at least set up the connection in advance with <link rel="preconnect" href="https://fonts.example.com" crossorigin>. Since font files are served with unchanging URLs, they get a long-lived cache header; for details, see the Cache-Control headers guide.
Reducing CLS with fallback font matching
The source of the shift during a font swap is that the fallback font (e.g. Arial) has different width and vertical metrics from the web font. The size-adjust, ascent-override, descent-override and line-gap-override descriptors defined in the CSS Fonts Module Level 5 draft let you bring a local system font close to the web font’s measurements:
/* Sample values: calculate them for your own font with a tool */
@font-face {
font-family: "Corporate Sans Fallback";
src: local("Arial");
size-adjust: 104%;
ascent-override: 92%;
descent-override: 24%;
line-gap-override: 0%;
}
body {
font-family: "Corporate Sans", "Corporate Sans Fallback", Arial, sans-serif;
}
The percentages above are only there to show the syntax. The correct values are calculated from the font’s own metric tables; open-source tools such as Capsize and Fontaine, or Next.js’s next/font module, do this calculation automatically. To verify the result, temporarily block the font (request blocking in the DevTools Network panel) and compare the two views overlaid. If line breaks fall in the same places, the matching is done.
Implementation checklist
Before putting the change live, go through this list in order:
- The family, weight and style combinations actually used on the site are listed; unused ones are removed.
- Fonts are served as WOFF2, from your own domain and with a subset that includes Turkish characters.
- Every
@font-facedefinition hasfont-displayandunicode-range. - At most two files for the first screen are preloaded with
crossorigin, and the URLs are identical. - Fallback font metric matching is done, and a visual comparison was made with the font blocked.
- Font files are published with a long-lived cache header and a new file name when changed.
- The LCP element and CLS sources in Lighthouse and field data were compared before and after the change.
The font and image layers are usually handled together; for image format and size optimization, take a look at the AVIF and WebP guide. If you want to handle the font, image and script layers on your corporate site within a single performance plan, see our web performance and Core Web Vitals service.
References: W3C CSS Fonts Module Level 4 (font-display, unicode-range), CSS Fonts Module Level 5 for the metric override descriptors, and W3C WOFF File Format 2.0.
Frequently asked questions
Is self-hosting Google Fonts always faster?
In most cases, yes. No DNS, TCP and TLS connection is set up for an extra domain; and since browsers partition the cache by site, there’s no longer the advantage of reusing a font downloaded on another site. But on your own hosting you have to set up the right unicode-range subset, WOFF2 compression and long-lived cache headers yourself; if these are missing, the gain is lost.
Does font-display: swap increase CLS?
It can. swap shows text first in the fallback font and swaps it when the web font arrives; if there’s a metric difference between the two fonts, line lengths and heights change, which is measured as layout shift. The remedy is metric matching for the fallback font with descriptors such as size-adjust and ascent-override.
Which subset is needed for Turkish characters?
ç, ö and ü are in the Latin-1 range (U+00C0–00FF); ğ, Ğ, ı, İ, ş and Ş are in Latin Extended-A. If only the basic Latin subset is used, these letters are drawn with the fallback font and the text looks mixed. Add at least the U+011E–011F, U+0130–0131 and U+015E–015F ranges to the subset, and the Turkish lira sign U+20BA if prices are shown.
How many font files should I preload?
One or two files are usually enough: the weights used for body text and headings on the first screen. Every preload competes for bandwidth with the other critical resources in the HTML. Preloading italic or bold variants not used on the first screen doesn’t improve LCP; it delays it.