Some international formatting requirements must accommodate mixing text of different writing directions.
The presentation of right-to-left scripts (e.g. Hebrew, Arabic, Thaana, and Syriac) may be embedded into the presentation of left-to-right scripts.
The stylesheet may be mixing its boilerplate text with authored content of either possible direction from many different sources to produce the combined result.
The formatter is responsible for placement and interpretation of glyphs on the page based on the character code points in the XSL-FO instance.
The stylesheet writer is responsible for protecting text, where possible, from being influenced in the XSL-FO instance being formatted.
Three aspects of writing direction influence the presentation of information in a line.
A line has an inline-progression direction determined by the writing direction of the closest ancestral reference area.
Information is flowed into lines in the inline-progression direction, independent of the visual order of the characters in the information.
A group of adjacent characters may have semantic affinity and would thus be required to be flowed into the lines in groups.
Groups are ordered in the inline-progression direction.
E.g., in a right-to-left progression direction there may be groups of left-to-right characters.
The groups are rendered right-to-left on the line, but the characters in each group are rendered left-to-right.
Without grouping, adjacent strings of the same direction would be rendered as a whole, losing the semantic affinity in the characters.
E.g., boilerplate information from the stylesheet is often semantically distinct from source file information, needing insulation from undue influence from the content.
Characters from different scripts have inherent writing directions that may differ from the inline-progression direction.
Usually it is necessary to respect the character direction while accommodating the inline-progression direction (this is the responsibility of the formatter).
It may be necessary to override the inherent direction for a special effect.
Many characters are not associated with any language and are influenced by their proximity to characters from different scripts.
Stylesheet writers can specify the progression direction of the information, the grouping of characters, and the respect or override of the inherent Unicode direction in characters.