Why Font Swaps Caused Layout Shift on Arabic Pages: A Metrics Mismatch Explained
A developer running a bilingual English and Arabic site found that the Arabic routes jumped on every cold load, moving the entire right-to-left column. The author argues that font-driven layout shift stems from a mismatch in metrics between the fallback font painted first and the webfont that replaces it, not from slow downloads, so a faster CDN would not help. Next.js's next/font automatically generates size-adjusted fallbacks for Latin text, but it derives them from Arial or Times New Roman and so does not cover Arabic, Cyrillic, or CJK scripts. The notes describe how average character width and the ascent-to-descent ratio determine how far content moves, and how font-display: optional can eliminate swap-driven shifts. The author recommends reproducing cold loads with caching disabled and throttling enabled, since a warm cache hides the problem during local testing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in