logo
Parslinks
Back to blog
Guides4 min read

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.

Alireza Tadi

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:

fonts.css
@font-face {
  font-family: 'BodyFa';
  src: url('/fonts/body-fa.var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
text7 lines

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.

Persian font loading, before and after

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.

  • 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.