HeadlinesBriefing favicon HeadlinesBriefing.com

Arabic Web Typography: Centuries of Technical Debt

Hacker News •
×

A frontend developer inherited a bug ticket about Arabic text rendering with ragged left edges instead of justified text. The design team expected proper justification, but production showed uneven margins. Three previous tickets for the same product revealed deeper issues: disconnected letters in PDFs, search indexes failing due to fossil Unicode codepoints from 1991, and systematic problems across the codebase.

The root cause spans centuries. Classical Arabic scribes developed kashida justification by elongating letterforms themselves, not spacing between words. Ibn Muqla codified this proportional system in 940 AD, measuring letters in rhombic dots and defining strict rules for elongation. Later masters like Ibn al-Bawwāb refined these techniques, creating manuscript traditions that justified text by shaping letters rather than adjusting spaces.

Modern web browsers ignore this entirely. CSS's text-align: justify stretches word spaces like Latin text, producing results Arabic scribes would find ugly. The author manually placed each kashida elongation to demonstrate proper rendering, revealing that even self-hosted webfonts like Amiri require workarounds for basic typographic features.

Arabic typography remains underserved on the web because browser engines treat connecting letters like isolated Latin characters. Five hundred years of systematic calligraphic refinement get discarded for a one-size-fits-all spacing approach that fundamentally misunderstands the script's shaping requirements.