Eliminate Font CLS in Arabic & Latin Sites (WOFF2)
Eliminate font CLS and FOUT in Arabic and Latin WordPress sites using local WOFF2 hosting, preload caps, unicode-range, and size-adjust.

- Webfont shifts happen when
font-display: swappaints fallback Arial/Tahoma first and swaps to Cairo, Tajawal, Inter, or Poppins 400 ms later with mismatched line-box heights and glyph widths. - Arabic fonts (
Cairo,Tajawal,Almarai,IBM Plex Sans Arabic) suffer 2x–3x worse CLS than Latin fonts because fallback system Arabic glyphs have radically taller ascenders/descenders and narrower character advance widths. - Self-hosting WOFF2 files under
kadicache-assets/fonts, preloading only 1–2 above-the-fold weights, subsetting viaunicode-range, and aligningsize-adjust+ascent-overridelocks CLS at0.000.
Table of Contents (10 sections)
- Why font-display: swap Alone Causes Layout Shifts (FOIT vs FOUT)
- Why Remote fonts.googleapis.com Amplifies Mobile FOUT Delay
- Layer 1: Self-Hosting WOFF2 Locally (Optimization/FontOptimizer.php)
- Layer 2: Preloading Critical Above-the-Fold WOFF2 (Without Starving Hero LCP)
- Layer 3: How Metric-Matched Fallback Fonts Eliminate Font CLS (size-adjust)
- Layer 4: Trimming WOFF2 Payload Size With unicode-range Subsetting
- Protecting Icon Fonts (FontAwesome, eicons, Dashicons, WoodMart Icons)
- 60-Second DevTools Verification for 0.000 Typography CLS
- Copy-Paste Fallback Metric Reference Table (Top 8 Arabic & Latin WordPress Fonts)
- Variable Fonts vs Static Weights: Which Wins on Mobile 4G?
To eliminate font CLS permanently on Arabic, English, and multilingual WordPress sites, you have to solve a two-sided browser physics problem. Turn on font-display: block and visitors stare at invisible headlines for two seconds (failing FCP and LCP). Flip blindly to font-display: swap over a slow remote CDN and headlines jump by 32 pixels when the custom .woff2 arrives (failing CrUX CLS at 0.16+).
Why font-display: swap Alone Causes Layout Shifts (FOIT vs FOUT)#
When Chrome parses your HTML, it discovers text nodes inside <h1> and <p> immediately, long before external font files finish downloading. Every @font-face rule forces the browser to choose between two rendering strategies during that network gap:
- FOIT (Flash of Invisible Text — browser default
block): Chrome reserves space using invisible glyphs for up to 3,000 milliseconds. Users on 4G mobile connections see blank white banners, and Lighthouse flags Ensure text remains visible during webfont load.
- FOUT (Flash of Unstyled Text —
font-display: swap): Chrome paints text on frame 1 using your OS fallback font (system-ui,Arial,Tahoma, orGeeza Pro). Once the custom WOFF2 finishes downloading, Chrome swaps the glyphs live on screen.
Why does that swap trigger a Cumulative Layout Shift (CLS) penalty? Because CLS measures whether existing visible elements change their bounding-box position between animation frames! If your 3-line fallback hero <h1> renders at 138px tall in Arial, and then reflows to 168px tall (wrapping onto 4 lines!) when Plus Jakarta Sans or Cairo swaps in, every button, image, and product card below that <h1> gets pushed down by 30px!
Typography Stack Tested (Mobile 390px Viewport) | OS Fallback Line-Box Height (3 Lines) | Custom WOFF2 Line-Box Height | Vertical Reflow Delta | Resulting Hero CLS |
|---|---|---|---|---|
Inter (700) over uncalibrated Arial | 126 px | 134 px (wraps 1 word) | +44 px | 0.084 (Borderline) |
Poppins (700) over uncalibrated Arial | 126 px | 152 px (wider glyphs + tall line) | +62 px | 0.138 (Fails CrUX!) |
Cairo (700 Arabic) over Windows/Android fallback | 132 px | 186 px (1.85 Arabic ascender/descender) | +54 px | 0.164 (Fails CrUX!) |
Tajawal (500/700 Arabic) over Tahoma | 128 px | 164 px | +36 px | 0.112 (Fails CrUX!) |
| Any Above + Local WOFF2 Preload + Metric Overrides | 164 px (pre-matched!) | 164 px | 0 px | 0.000 (Locked) |
Why Remote fonts.googleapis.com Amplifies Mobile FOUT Delay#
Before Chrome can even start downloading a Google Font hosted externally, it has to climb a four-step network waterfall:
- Download and parse your HTML document.
- Open a first cross-origin connection (DNS lookup + TCP + TLS handshake) to
https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700...to fetch the browser-sniffed CSS file. - Parse that CSS file only to discover that the actual
.woff2binaries live on a second separate domain:https://fonts.gstatic.com! - Open a second cross-origin connection (another DNS + TCP + TLS handshake) to
fonts.gstatic.combefore the first font byte ever crosses the wire.
Notice one more hidden HTTP cache penalty that modern browsers introduced after 2020: HTTP Cache Partitioning. Years ago, tutorials claimed leaving fonts on fonts.gstatic.com meant visitors "already had Inter or Cairo cached from other websites." Today, Chrome, Safari, and Firefox partition disk caches strictly by top-level site origin (example.com). A visitor never shares fonts.gstatic.com cache entries across different websites anymore—so remote Google Fonts pay two cross-origin connection penalties for zero shared-cache benefit, while also exposing visitor IP addresses under European GDPR rulings!
Layer 1: Self-Hosting WOFF2 Locally (Optimization/FontOptimizer.php)#
Inside WP Admin -> KadiCache -> Fonts, enabling Self-Host Google Fonts activates Optimization/FontOptimizer.php and Optimization/Fonts/FontAssetDownloader.php in KadiCache Free Core:
- Single-Origin HTTP/2 & HTTP/3 Multiplexing: KadiCache fetches the Google Fonts CSS and
.woff2subsets once in the background, stores them cleanly inside/wp-content/cache/kadicache-assets/fonts/(PUBLIC_DIRECTORY = 'kadicache-assets/fonts',MAX_ASSETS = 256), and rewrites<link>,<style>, and eligible inline loader URLs to your own domain.
- Automatic
font-display: swapRepair (FontCss::addSwapWhereMissing()): Custom theme icon fonts and Elementor custom uploaded fonts frequently omitfont-displayaltogether inside@font-faceblocks. KadiCache scans inline<style>and local stylesheets and injectsfont-display: swapwherever missing.
- CSP, Subresource Integrity & Mixed-Family Respect: Look at lines 105–155 of
FontOptimizer.php: if your server sends strictContent-Security-Policyheaders,integrityhashes, or an excluded font family (local_font_exclusions), KadiCache preserves the original tag untouched rather than breaking security policies.
Layer 2: Preloading Critical Above-the-Fold WOFF2 (Without Starving Hero LCP)#
Once your .woff2 files live on your own origin, the browser still discovers @font-face URLs late—only after parsing CSS and matching a DOM node that uses font-family: 'Cairo'. If that font arrives within the first ~100 ms of navigation, Chrome paints the real custom font on Frame 1 with zero visible swap and zero CLS!
Use <link rel="preload" as="font" type="font/woff2" crossorigin> surgically inside WP Admin -> KadiCache -> Fonts (documented in our Local Google Fonts & Preload guide):
<!-- Correct: Preload ONLY the 1–2 primary above-the-fold WOFF2 subsets (always include crossorigin!) -->
<link rel="preload" href="/wp-content/cache/kadicache-assets/fonts/cairo-arabic-700.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/cache/kadicache-assets/fonts/cairo-arabic-400.woff2" as="font" type="font/woff2" crossorigin>Watch out for two classic developer mistakes with font preloading:
- Forgetting the
crossoriginattribute — EVEN on same-origin local fonts! Per the W3C Fetch specification,@font-facerequests always use anonymous CORS mode. If you write<link rel="preload" as="font" href="/fonts/cairo.woff2">withoutcrossorigin, Chrome downloadscairo.woff2twice—wasting 45 KB of critical bandwidth!
- Preloading 7 weights (
300,400,400i,500,600,700,800): Every preloaded font competes at high priority with your hero<img>over mobile 4G. Cap manual preloads to at most 2 critical above-the-fold WOFF2 files (or let Cloud Font Optimization select the exact above-the-fold subsets automatically).
Layer 3: How Metric-Matched Fallback Fonts Eliminate Font CLS (size-adjust)#
What happens on a rural 3G connection or cold p75 mobile visit where even a local preloaded .woff2 takes 280 ms to arrive? That is where modern CSS Font Loading Level 5 descriptors eliminate font CLS mathematically.
Instead of letting fallback Arial or Tahoma render with its own native metrics, you declare a synthetic @font-face wrapper around the local system font with four calibrated descriptors:
size-adjust: Scales overall glyph width and em-box size so line breaks occur at the exact same word boundaries as your custom webfont.ascent-override: Matches the height above the typographic baseline (critical for tall Arabicalef/lamand diacritic headroom!).descent-override: Matches the depth below the baseline (y,g, Arabicnoon/yaabowls).line-gap-override: Zeros or matches external leading between lines.
Here are two production-tested CSS fallback recipes—one for Latin (Inter / Plus Jakarta Sans) and one for Arabic RTL (Cairo / Tajawal)—that lock paragraph height before the WOFF2 swaps in:
/* 1. Calibrated Fallback for Inter / Modern Geometric Sans (Latin) */
@font-face {
font-family: "Inter-Fallback";
src: local("BlinkMacSystemFont"), local("Segoe UI"), local("Arial");
size-adjust: 107.4%;
ascent-override: 90.2%;
descent-override: 22.5%;
line-gap-override: 0%;
}
/* 2. Calibrated Fallback for Cairo (Arabic RTL + Latin Bilingual) */
@font-face {
font-family: "Cairo-Arabic-Fallback";
src: local("Tahoma"), local("Segoe UI"), local("Geeza Pro"), local("sans-serif");
size-adjust: 104.8%;
ascent-override: 130.4%;
descent-override: 56.8%;
line-gap-override: 0%;
}
body {
font-family: "Cairo", "Cairo-Arabic-Fallback", sans-serif;
}Look at ascent-override: 130.4% and descent-override: 56.8% on Cairo-Arabic-Fallback (130.4% + 56.8% = 187.2%, matching Cairo's exact 1.872 UPM vertical bounding box!). Without those two lines, fallback Tahoma renders at ~1.21 em height and jumps +54px when Cairo.woff2 activates. With those overrides—generated automatically per font family inside Cloud Font Optimization—the fallback container height matches within 0–1px, producing 0.000 CLS!
Layer 4: Trimming WOFF2 Payload Size With unicode-range Subsetting#
Full multilingual variable fonts (Noto Sans Arabic, Cairo, IBM Plex Sans Arabic, Inter Variable) often weigh 95 KB to 280 KB when un-subsetted because they pack Vietnamese, Cyrillic, Greek, Extended Latin, math symbols, and archaic ligatures into a single binary.
Splitting fonts by unicode-range ensures browsers download only the script blocks actually present in the page DOM:
- Arabic Subset (
U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF): Typically18 KB – 29 KBin compressed WOFF2. - Basic Latin Subset (
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F): Typically14 KB – 21 KBin compressed WOFF2.
If an English landing page contains zero Arabic characters, Chrome sees the unicode-range rule and downloads 0 bytes of the Arabic WOFF2 file! Conversely, on an Arabic WooCommerce product page displaying prices in SAR or EGP alongside English brand names, Chrome streams both lean 20 KB subsets in parallel over HTTP/3.
Protecting Icon Fonts (FontAwesome, eicons, Dashicons, WoodMart Icons)#
One important rule when subsetting or overriding fonts: never apply text fallback size-adjust or aggressive ASCII glyph stripping to Private Use Area (U+E000-F8FF) icon fonts! Better yet, enable Elementor's native Inline Font Icons (SVG) and KadiCache's Disable Guest Dashicons (Bloat Removal), or exclude custom theme icon families inside Cloud Font Optimization Exclusions.
60-Second DevTools Verification for 0.000 Typography CLS#
Test your typography stack under real network stress right inside Chrome DevTools:
- Open DevTools -> Network, filter by
Font, and reload in Incognito: confirm0requests go tofonts.googleapis.comorfonts.gstatic.com, and all.woff2files return from your own domain/CDN with200(single download—never duplicated!).
- Switch Network throttling to Slow 4G, open Rendering drawer (
Ctrl+Shift+P-> Show Rendering), check Layout Shift Regions, and reload: confirm blue shift flashes do not appear around your hero<h1>or navigation links when.woff2files swap in.
Copy-Paste Fallback Metric Reference Table (Top 8 Arabic & Latin WordPress Fonts)#
Calculating size-adjust, ascent-override, and descent-override from raw OpenType head (unitsPerEm) and hhea / OS/2 tables takes tedious math (ascent / (unitsPerEm × sizeAdjust)). Use this verified lookup table for the eight most common Google Fonts deployed across English and Arabic WordPress themes:
| Google Font Family | Script | Recommended Local Fallback | size-adjust | ascent-override | descent-override | line-gap-override |
|---|---|---|---|---|---|---|
| Inter | Latin | Arial, Segoe UI | 107.4% | 90.2% | 22.5% | 0% |
| Plus Jakarta Sans | Latin | Arial, Helvetica Neue | 105.8% | 96.4% | 24.1% | 0% |
| Poppins | Latin | Arial, Segoe UI | 112.6% | 93.2% | 31.1% | 8.9% |
| Roboto | Latin | Arial, Helvetica | 100.1% | 92.7% | 24.4% | 0% |
| Montserrat | Latin | Arial, Verdana | 113.2% | 85.5% | 22.2% | 0% |
| Cairo | Arabic + Latin | Tahoma, Geeza Pro | 104.8% | 130.4% | 56.8% | 0% |
| Tajawal | Arabic + Latin | Tahoma, Geeza Pro | 98.6% | 101.4% | 39.6% | 0% |
| IBM Plex Sans Arabic | Arabic + Latin | Tahoma, Segoe UI | 102.5% | 104.9% | 38.2% | 0% |
Variable Fonts vs Static Weights: Which Wins on Mobile 4G?#
Designers often ask whether uploading a single Variable WOFF2 (Cairo[slnt,wght].woff2 or Inter-Variable.woff2) beats loading static weights (400, 600, 700). Apply the 2.5-Weight Rule:
- If your page uses only 1 or 2 font weights (for example
400Regular body text and700Bold headings), two static subsetted WOFF2 files (17 KB + 18 KB = 35 KB) are smaller and faster than a full variable axis file (58 KB – 95 KB). - If your design genuinely renders 3 or more weights above and below the fold (
400,500,600,700,800), a single subsetted Variable WOFF2 (font-weight: 100 900;) wins cleanly in one HTTP/3 stream.
Frequently Asked Engineering Questions
Why does adding font-display: swap sometimes INCREASE Cumulative Layout Shift (CLS)?
Why do bilingual Arabic + English WordPress sites experience larger font shifts than English-only sites?
How many WOFF2 font files should I preload in <head>?
Does self-hosting Google Fonts in KadiCache also solve European GDPR / German court IP privacy rulings?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.
Self-host WOFF2 locally, trim unused glyph ranges, and align fallback font boxes.
Configure kadicache-assets/fonts, font-display: swap, and critical WOFF2 preloads.
Understand impact fraction × distance fraction math and lock 0.000 visual stability.
Eliminate invisible text flashes without introducing late FOUT layout jumps.