How do you justify Arabic text? It’s a simple question, but—as cataloged in a lengthy interactive post on the blog La Vita Nouva—it has a remarkably deep and fascinating answer.
The story begins with a single support ticket complaining that “a block of mixed-content Arabic prose on the customer-facing dashboard was rendering with a ragged left edge (the rag falls on the left in Arabic, since the lines set out from the right margin; the ticket said ‘ragged right’) when the design team had explicitly specified justified text.”
Before we dive into this, just so we’re clear—and so I don’t have to keep using phrases like “justifying Arabic”, which unfortunately sounds somewhat awkward in the current political climate—”justification” in this context means stretching the text so that it sits flush with both margins. OK? Good.
So: how do you justify a block of text? If you’re dealing with the Latin alphabet we use for English, the answer is relatively simple—you simply increase the space between words. If you’re a little more sophisticated about it, you can also hyphenate words and perhaps increase the space between letters, although you can only go so far with the latter approach before the words themselves start to decohere and read as individual letters.
Arabic works differently. Formal written calligraphy, of the type seen in Qur’ans and other written manuscripts, flows to both margins, a technique pioneered by an ill-fated 10th-century scribe named Ibn Muqla. The rules for achieving this were complex, but can be summarized by a technique called “kashida,” which dictates that, as La Vita Nouva (henceforth LVN) puts it, “You justify by reshaping the letters, not by spacing the words.”
This fact goes a long way towards explaining why written Arabic is so elegant and beautiful—but also why reproducing this written style has proven a nightmare for generations of typsetters. Ever since the Gutenberg press, typography has revolved around the idea that glyphs are discrete and immutable: a given letter looks the same on the first page of a text as it does on the last.
This works beautifully for Latin alphabets, and for scripts like Cyrillic, Greek, and others that are comprised of a small number of discrete letters. Other scripts, however, don’t fit this paradigm particularly well, for several reasons. Take Chinese, for example, with far more characters than could ever fit on a typewriter; or Devanagari, with its distinctive line across the top of words; or Arabic with its fluid, mutable characters.
As LVN explains, Arabic is essentially the opposite of the one-glyph-for-every-letter approach, and why it gave early typographers conniptions: “Arabic is cursive always. There is no print-versus-handwriting distinction, no block letters…Each letter, therefore, changes shape depending on its neighbors (an isolated form, an initial, a medial, a final), and six letters refuse to connect forward at all, which breaks words into joined clusters and gives the script its rhythm.”
So before we even get anywhere near the question of justification, there’s the question of how to actually render Arabic text. The naïve approach, of simply adopting the same one-glyph-per-letter system used for Latin text, can produce some spectacularly bad results. LVN provides the following examples. The writing says, “Hello world, this is Arabic text”; on the left is how it’s supposed to look, and on the right is how it looks when the letters are rendered as discrete glyphs:

The history of Arabic and movable type is littered with such examples, and it took until the 1820s for a printing system that could render Arabic properly to arrive. This is because, as LVN explains, “where a Latin [font] needs somewhere around a hundred sorts, a serious [Arabic] [font] needed many hundreds: positional forms, ligatures, vowel marks, every one a separately cut piece of metal, and a compositor who could navigate that case fast enough to keep his job.”
It feels like digital typography should be able to solve this problem: even for Latin scripts, modern fonts ship with multiple glyphs for every character. And it has done: LVN cites several examples of fonts that produce “[Arabic] that calligraphers will sign off on.” The problem today isn’t so much that solutions don’t exist, but that the implementation of, and support for, those solutions remains patchy—especially on the internet, where text that renders beautifully in one browser can look awful in another.
This is unfortunate, given that the majority of the reading we do today is done via internet browsers. As LVN puts it, “The awkward bit is that the renderers that cannot stretch a letter are the ones everyone now reads everything in… [and] the maddening part is that proper Arabic justification is not an unsolved research problem.” The result is that, for all our modern technological wizardry, resolving support tickets like the one LVN received ultimately falls back on the same time-honored solution pioneered a millennium ago: fixing things slowly and painstakingly by hand.
READ MORE: Why ‘ji32k7au4a83’ Is a Remarkably Common Password