Fast Persian web fonts: subsets, preload and text that doesn't jump
Arabic-script fonts are heavy. Here's how to ship them without blank screens or layout shift, and why the lessons apply to any non-Latin script.
Co-founder & Head of Development and Communications, Parslinks
We build Parslinks for a bilingual audience, so this one is personal. Our own marketing site ships a Persian typeface alongside a Latin one. In an early version, the Persian font alone came in four weights totalling over 600 KB. On a slow connection, readers saw a blank page, then text in a system font, then a full reflow as the real font arrived.
The same problem hits anyone serving Arabic, Hebrew, Devanagari or CJK text: these fonts carry far more glyphs than Latin ones. The fixes are the same too.
1. Fewer files: variable fonts
A variable font packs every weight into one file. Instead of separate light, regular, semibold and bold files, you ship one, usually smaller than the four combined. Most well-maintained Persian and Arabic families now offer a variable version.
2. Fewer bytes: WOFF2 and subsetting
Always use WOFF2; it's the best-compressed format and every modern browser supports it.
Many Arabic-script fonts also include Latin letters, extended Arabic and presentation forms you may not need. If you already have a Latin font, restrict the Persian one to its script with unicode-range:
unicode-range tells the browser this font only covers those characters. If a page has no Persian text, the file isn't downloaded at all. Keep U+200C (the zero-width non-joiner) in range: Persian uses it constantly inside words, and if it falls back to another font, word shapes break.
3. Earlier: preload exactly one font
Browsers discover fonts late: HTML, then CSS, then the font. preload short-circuits that. But preload only the font used above the fold, usually the body face. Preloading every font steals bandwidth from images and scripts that matter more.
In Next.js, next/font/local handles this for you: it self-hosts the file, preloads it and generates a metric-matched fallback.
4. No jump: font-display and a matched fallback
font-display: swap shows text immediately in a system font, so there's no blank page. The catch is the reflow when the real font arrives, because the fallback has different widths and line height.
The fix is to tune the fallback with size-adjust and ascent-override so it occupies nearly the same space. The swap then becomes almost invisible.
The outcome
Four static files became one variable WOFF2, the Persian face was scoped to its script and only the body font was preloaded. Font weight on article pages dropped from over 600 KB to around 120 KB, the blank flash disappeared and CLS fell from 0.24 to 0.02. For content sites, our static vs. SSR comparison covers the next big win.
Frequently asked questions
Join the discussion
No comments yet. Be the first to share your thoughts.
Related posts
- Platform
Static site or server rendering? Cost and speed in practice
We built a 30-page marketing site with a CMS twice: once static, once server-rendered. This post puts the numbers side by side, shows where static wins, where SSR is necessary, and how ISR gets you the best of both.
- Guides
High TTFB in Next.js: finding the bottleneck, layer by layer
TTFB is the time from a user's request to the first byte of the response, and in Next.js it's made of network, middleware, data fetching and rendering. This post shows how to measure each layer separately and fix the most common culprits with code examples.
- Guides
Cache-Control headers for a modern front end: a recipe for every kind of file
Cache-Control is one header with a few words, but each word changes how browsers, CDNs and servers behave. This post explains each directive simply, suggests a safe recipe for every kind of response, and shows two costly mistakes.
