100% Local WASM:Zero Server Uploads — Your font binaries never leave your browser.

Fix LCP Custom Web Fonts on PageSpeed

Cut font transfer time by 85%+ and eliminate font-swap layout shifts to pass Core Web Vitals.

Max file: 25 MBBatch: 1 font (Free)

Drop .ttf, .otf, .woff, or .woff2 font files here

Validates OpenType magic bytes locally. Files never leave your device.

Font EULA, SIL OFL & Apache 2.0 Compliance Responsibility

Subsetting, format conversion to WOFF2, and variable-axis instancing are technical transformations executed locally in your browser. You are solely responsible for verifying that your font license permits web embedding, subsetting, or modification under its End User License Agreement (EULA), the SIL Open Font License (OFL 1.1), or the Apache License 2.0. See our Terms & EULA Notice and Privacy Policy.

OpenType name table copyright and license strings extracted by the Inspector are displayed for convenience and do not constitute legal advice.

Benchmark WOFF2 Size & LCP Reductions

Font / Preset Original Size Subsetted WOFF2 Reduction Est. LCP Gain
Hero Display Font (OTF -> WOFF2) 380 KB 19.2 KB 94.9% ~720 ms (4G) / 7.2 s (3G)
Body Sans Regular (TTF -> WOFF2) 215 KB 15.1 KB 93.0% ~400 ms (4G) / 4.0 s (3G)
Numeric Pricing Font 160 KB 4.8 KB 97.0% ~310 ms (4G) / 3.1 s (3G)

Production @font-face CSS Example

@font-face {
  font-family: 'Brand Display';
  src: url('/fonts/BrandDisplay.subset.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

Why fixing LCP caused by custom web fonts Matters for Production Web Performance

When your hero headline is the Largest Contentful Paint (LCP) element, a 300 KB custom font forces the browser to either hide text (FOIT) or trigger a jarring layout shift (CLS) when it finally arrives.

Unoptimized desktop font files routinely ship thousands of glyphs, legacy kern tables, and unused script blocks that the browser must download, parse, and rasterize before painting text. On mobile networks, a single 450 KB font file can delay First Contentful Paint (FCP) and Largest Contentful Paint (LCP) by 800 ms to 2,500 ms. By running fixing LCP caused by custom web fonts directly in your browser via WebAssembly, you eliminate dead bytes before they ever reach your CDN edge.

Unlike legacy server-side pipelines that require uploading proprietary or licensed font binaries to third-party servers, UltraStack FontSubset executes HarfBuzz (hb-subset.wasm) and Google wawoff2 inside an isolated Web Worker. Your font binary stays in volatile browser memory, is inspected for OpenType metadata and EULA strings, and is compressed into a standards-compliant WOFF2 payload in milliseconds.

How HarfBuzz WASM & WOFF2 Brotli Compression Work Under the Hood

UltraStack attacks both LCP and CLS simultaneously: HarfBuzz + wawoff2 shrink the critical-path WOFF2 below 25 KB, while metric-matched fallback CSS keeps hero text visible and dimensionally locked from millisecond zero.

During subsetting, HarfBuzz constructs a glyph closure graph starting from your selected Unicode codepoints (for example, Latin Basic U+0000-00FF, Currency & Numerals including ₹ U+20B9, or non-Latin scripts such as Devanagari, Arabic, and Cyrillic). Rather than naively deleting glyph outlines, hb-subset traces GSUB substitution lookups (ligatures, small caps, contextual alternates, and Indic conjuncts) and GPOS positioning rules (kerning pairs and mark-to-base anchors) so every reachable glyph and layout rule remains intact.

Once the SFNT tables (glyf/loca or CFF, cmap, hmtx, head, hhea, OS/2, GSUB, GPOS) are compacted, wawoff2 applies WOFF2 table transforms and Brotli entropy coding. Because WOFF2 reconstructs predictable locatable offsets and delta-encodes glyph coordinates, it typically achieves 30% to 50% smaller file sizes than WOFF1 and 60% to 92% smaller payloads than raw TTF or OTF files.

Step-by-Step Optimization Workflow

1. Drop your hero heading and body fonts into UltraStack. 2. Subset to Latin Basic + Currency & Numerals to minimize critical-path bytes. 3. Copy the generated @font-face with font-display: swap and CLS fallback rules. 4. Preload the primary WOFF2 file in your document <head>.

After generating the subsetted .woff2 output, always verify glyph coverage using the Live Specimen Previewer's Before vs. After toggle. Toggling between the original Blob URL and the newly subsetted WOFF2 Blob URL injects both fonts into document.fonts so you can visually confirm kerning, diacritics, currency symbols, and variable-font axis interpolation before deploying.

Finally, copy the generated @font-face CSS block—including font-display: swap, exact unicode-range descriptors, and the metric-matched fallback @font-face rule using size-adjust, ascent-override, descent-override, and line-gap-override—directly into your global stylesheet.

Eliminating Cumulative Layout Shift (CLS) with Metric-Matched Fallbacks

Subsetting shrinks download time, but even a 15 KB WOFF2 file takes tens of milliseconds over a cold TLS connection. When the browser renders fallback system text (such as Arial or Helvetica) and later swaps in your custom web font, differences in x-height, ascender, descender, and average advance width cause text reflow—triggering Cumulative Layout Shift (CLS) penalties in Core Web Vitals.

To eliminate layout shift, UltraStack FontSubset reads your font's OS/2 (sTypoAscender, sTypoDescender, sTypoLineGap, sxHeight) and hhea vertical metrics alongside unitsPerEm. It computes a calibrated size-adjust percentage and matching ascent-override, descent-override, and line-gap-override percentages on a local system fallback @font-face. The fallback text occupies the exact same vertical and horizontal bounding box as your web font, resulting in near-zero CLS during font swap.

Frequently Asked Questions

How do custom web fonts hurt PageSpeed LCP? +

Large font files delay text paint or compete with hero images for bandwidth on mobile connections.

Should I use font-display: swap or optional? +

font-display: swap ensures immediate text visibility, and pairing it with size-adjust fallback CSS prevents layout shift when the swap occurs.

How small should my subsetted WOFF2 be for fast LCP? +

Aim for under 25 KB for Latin Basic body weights and under 10 KB for numeric or display-headline subsets.

Does UltraStack estimate 3G and 4G LCP savings? +

Yes. Every subset operation displays an instant Slow 3G and Fast 4G transfer-time savings readout.

Should I preload my subsetted WOFF2? +

Yes, add <link rel="preload" as="font" type="font/woff2" crossorigin> for your primary above-the-fold weight.

More Font Optimization Guides