Skip to main content
KadiCache
Engineering Journal · Core Web Vitals9 min read1,936 wordsVerified 2026-11-23

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.

Arabic and Latin WOFF2 typography locked inside precision dimension rulers with CLS 0.00 badge
0.000 Layout Shift10 Sections✓ Verified
⚡ Executive Summary · 30-Second Spec100% Code-Verified
WP Admin Path
WP Admin -> KadiCache -> Fonts (Local Hosting + Preload + Cloud Subsetting)
Measured Impact
0.000 Typography CLS · 2 Cross-Origin TLS Handshakes Saved
DevTools Proof Marker
kadicache-assets/fonts/*.woff2 | size-adjust | font-display: swap
  • Webfont shifts happen when font-display: swap paints 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 via unicode-range, and aligning size-adjust + ascent-override locks CLS at 0.000.
Table of Contents (10 sections)

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, or Geeza 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 HeightVertical Reflow DeltaResulting Hero CLS
Inter (700) over uncalibrated Arial126 px134 px (wraps 1 word)+44 px0.084 (Borderline)
Poppins (700) over uncalibrated Arial126 px152 px (wider glyphs + tall line)+62 px0.138 (Fails CrUX!)
Cairo (700 Arabic) over Windows/Android fallback132 px186 px (1.85 Arabic ascender/descender)+54 px0.164 (Fails CrUX!)
Tajawal (500/700 Arabic) over Tahoma128 px164 px+36 px0.112 (Fails CrUX!)
Any Above + Local WOFF2 Preload + Metric Overrides164 px (pre-matched!)164 px0 px0.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:

  1. Download and parse your HTML document.
  2. 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.
  3. Parse that CSS file only to discover that the actual .woff2 binaries live on a second separate domain: https://fonts.gstatic.com!
  4. Open a second cross-origin connection (another DNS + TCP + TLS handshake) to fonts.gstatic.com before 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!

FIG 01Self-host Google Fonts locally, subset WOFF2 glyph ranges in the cloud, and synthesize metric-matched fallback @font-face rules.Zoom 2x

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 .woff2 subsets 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: swap Repair (FontCss::addSwapWhereMissing()): Custom theme icon fonts and Elementor custom uploaded fonts frequently omit font-display altogether inside @font-face blocks. KadiCache scans inline <style> and local stylesheets and injects font-display: swap wherever missing.
  • CSP, Subresource Integrity & Mixed-Family Respect: Look at lines 105–155 of FontOptimizer.php: if your server sends strict Content-Security-Policy headers, integrity hashes, 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):

HTML
<!-- 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:

  1. Forgetting the crossorigin attribute — EVEN on same-origin local fonts! Per the W3C Fetch specification, @font-face requests always use anonymous CORS mode. If you write <link rel="preload" as="font" href="/fonts/cairo.woff2"> without crossorigin, Chrome downloads cairo.woff2 twice—wasting 45 KB of critical bandwidth!
  1. 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).
FIG 02Preload critical above-the-fold local WOFF2 fonts and exclude specific Google Font families when needed.Zoom 2x

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 Arabic alef/lam and diacritic headroom!).
  • descent-override: Matches the depth below the baseline (y, g, Arabic noon/yaa bowls).
  • 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:

CSS
/* 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): Typically 18 KB – 29 KB in compressed WOFF2.
  • Basic Latin Subset (U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F): Typically 14 KB – 21 KB in 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.

FIG 03Exclude specific pages or font families from Cloud WOFF2 subsetting and metric-matched fallback generation.Zoom 2x

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:

  1. Open DevTools -> Network, filter by Font, and reload in Incognito: confirm 0 requests go to fonts.googleapis.com or fonts.gstatic.com, and all .woff2 files return from your own domain/CDN with 200 (single download—never duplicated!).
  1. 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 .woff2 files 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 FamilyScriptRecommended Local Fallbacksize-adjustascent-overridedescent-overrideline-gap-override
InterLatinArial, Segoe UI107.4%90.2%22.5%0%
Plus Jakarta SansLatinArial, Helvetica Neue105.8%96.4%24.1%0%
PoppinsLatinArial, Segoe UI112.6%93.2%31.1%8.9%
RobotoLatinArial, Helvetica100.1%92.7%24.4%0%
MontserratLatinArial, Verdana113.2%85.5%22.2%0%
CairoArabic + LatinTahoma, Geeza Pro104.8%130.4%56.8%0%
TajawalArabic + LatinTahoma, Geeza Pro98.6%101.4%39.6%0%
IBM Plex Sans ArabicArabic + LatinTahoma, Segoe UI102.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 400 Regular body text and 700 Bold 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)?
Without font-display: swap, browsers hide text for up to 3 seconds (FOIT — Flash of Invisible Text), hurting FCP and LCP. Adding font-display: swap paints fallback system text immediately, which fixes FCP—but when the custom WOFF2 arrives 350 ms later with a different x-height or line height, the paragraph reflows vertically and triggers a CLS penalty unless fallback metrics are calibrated.
Why do bilingual Arabic + English WordPress sites experience larger font shifts than English-only sites?
Most Arabic display families (Cairo, Readex Pro, Tajawal) carry generous vertical line-gap metrics for diacritics (tashkeel), whereas Windows Segoe UI / Tahoma and Android Noto Sans Arabic use tighter default line boxes. Swapping uncalibrated fallback Arabic text shifts every below-the-fold card by 18px to 54px.
How many WOFF2 font files should I preload in <head>?
Preload at most 1 to 2 critical above-the-fold WOFF2 files (for example, your primary heading weight and body regular subset). Preloading 6 or 8 weights steals HTTP/3 bandwidth from your hero LCP image and ironically slows down custom font arrival!
Does self-hosting Google Fonts in KadiCache also solve European GDPR / German court IP privacy rulings?
Yes. FontOptimizer.php downloads stylesheets and WOFF2 binaries locally into kadicache-assets/fonts on your own domain, so visitor browsers never open connections to fonts.googleapis.com or fonts.gstatic.com and never transmit visitor IP addresses to Google font servers.
Verified WordPress Architecture · Core Web Vitals
Apply these exact optimizations on your WordPress or WooCommerce site in 2 minutes.
E-E-A-T Source Verified

Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.

Optimization/FontOptimizer.phpOptimization/FontCss.phpOptimization/Fonts/FontAssetDownloader.phpOptimization/ResourceHints.php
Connected Topical Cluster · Continue Deepening Your Setup