The Silent Performance Killer
For a marketing or corporate landing page, user experience is directly tied to loading speed. One of the most common reasons for high Largest Contentful Paint (LCP) times and layout shifts (CLS) is how custom typography is handled.
Loading fonts from external CDNs (like default Google Fonts link tags) creates multiple blocking request cycles:
- Fetching the HTML.
- Requesting the external CSS file.
- Fetching the actual
.woff2font files from another domain.
This process delays text rendering and causes jarring visual jumps when standard fallback fonts are replaced by custom typography.
Slashing Overhead with Variable Fonts
Instead of downloading individual static files for each font weight and style (e.g. Regular, Medium, SemiBold, Bold, and their italic counterparts), we leverage Variable Fonts. A variable font packs an entire weight spectrum (like 100 to 900) into a single, highly compressed .woff2 file.
This reduces the total weight of typography assets and eliminates duplicate download overhead.
Technical Implementation Checklist
Novexia enforces three constraints to ensure high font performance:
- Self-Hosting: Font assets are saved locally under
/public/fonts/. This keeps DNS resolution times to zero and leverages Cloudflare’s edge caching. - Selective Preloading: In our HTML head, we preload only the critical variable files needed for the above-the-fold content (Geist for UI and Fraunces for display headings):
<link rel="preload" href="/fonts/geist-1.woff2" as="font" type="font/woff2" crossorigin /> - CSS Font Display Swap: We configure
@font-facewithfont-display: swapto ensure text renders immediately using system fallbacks while the font downloads.
By implementing this architecture, we keep our baseline JavaScript bundle size at 0KB and maintain an LCP of under 1.2s across both desktop and mobile devices.