Description
This issue is applicable to Modern Standard Arabic and Persian.
This gap relates to ‘full justification’ of text in paragraphs. See elsewhere for stretch-to-fit mechanisms that fit single-line text to a specific width.
Effective full justification of Arabic script text requires the application of various strategies, usually applied in concert.
The techniques used include the following. Using a single technique on its own will usually produce results that are well below expectations.
- Adjust inter-word spaces.
- Make micro-adjustments to inter-character spaces within a word, where they exist (ie. where a letter doesn't join with the following letter).
- Use swash forms or wider glyphs for certain characters.
- Stretch the baseline connection between letters, often referred to as kashida (as opposed to tatweel). This should ideally involved curved extensions to the baseline, rather than just flat extensions.
- Insertion of tatweel characters (baseline extenders) between certain letters. Not recommended!
- Application of ligated forms to selected character sequences in order to reduce the width of certain words.
These techniques need to be used in combination to produce the best results. Rules also need to be established about how and where to apply these rules. For example, kashida extensions or swash forms may be more common towards the end of the line, but can only be used for certain character combinations. There may also need to be a limitation on the number of stretching techniques used per word, and some words may not be suitable for stretching at all. If more extensive application of kashidas or swashes is needed, the rules for distributing those across a line need to be followed, but those rules may be subject to author preferences. Authors may also have preferences about the order in which spaces, swashes, and kashidas are used while trying to optimise the balance of the text in a line, and the extent to which each is allowed on a single line. Sophisticated engines will take the whole paragraph into account when applying these rules, in order to achieve the most balanced effect on each line.
Author insertion of tatweel characters to stretch the baseline is only useful in highly constrained environments where the width and layout of the text is fixed. If tatweel characters are applied to paragraphs of ordinary HTML text, they will fail to justify the text correctly any time a user stretches the web page's window, or increases font size, etc. (Not to mention the problems that arise during editing if text is added or removed at the beginning of a long paragraph.) In such a dynamic environment, the justification has to be re-evaluated and re-applied every time the text changes. Tatweel insertion may be useful as a last resort if the application chooses where to insert the tatweel characters while justifying, but will still not often produce desirable results.
It is also important to note that the rules may change from one context to another. For example, rules for justifying text in a nastaliq font may be very different from those used for justifying text in a naskh font. Some typographic styles, such as ruq'a, traditionally avoid stretching letters or baselines, and rely instead on inter-word spacing for justification.
Finally, note also that the positioning of diacritics may need to vary slightly when they occur with stretched letters.
More:
- Arabic script resources, Text alignment & justification
- Arabic & Persian Layout Requirements, Text alignment & justification
The GAP
Browsers don't currently support the combination of these various justification techniques, nor do they allow authors to specify rules about how they are applied. Justification relies solely on inter-word spacing. This doesn't match the text that is seen in published, non-Web Arabic texts.
Currently, CSS specifications do not provide these advanced features, but recommend that the implementations select the justification strategy appropriate to the text. See the text-justify property.
Neither Gecko, Blink, nor Webkit browsers do more than stretch inter-word spaces.
Priority
Despite the fact that this poses some technical challenges, it is important if we want to make web-based text an equal partner with general text publications in Arabic. The priority is therefore assigned as Basic.
Tests & results
Action taken
tbd
Outcomes
tbd
Metadata
Metadata
Assignees
Labels
Type
Projects
Status