Introduction to bidirectional languages

Layouts and layout transformations

Bidi scripts require layouts and transformations to handle text flow.

Bidirectional text may assume different layouts. This refers to the directionality of some of the segments of the text, such as text with visual text type or with logical text type, or with right-to-left global orientation, or with left-to-right global orientation. In Arabic scripts it also pertains to the shaping of characters and the numeral shapes used. Layout transformation functions, also called layout functions or layout services functions, are required to transform between different layouts.

Layout attributes
Wherever bidi text is located, an associated set of bidi text descriptors (also known as layout values, or bidi attributes) is needed in order to know what the actual layout of text is and how it is to be transformed. These attributes are almost never a part of the text itself and are stored externally in resource files that are known to higher level protocol applications.

The primary layout attributes are defined below:

Orientation. Identifies where in the presentation area bidirectional text starts: right-to-left, left-to-right, or contextual (based on the directionality of the first character that has a defined direction).

Text-type. Identifies what kind of algorithm is used when transforming the text layout. There are several types of algorithms:

Text shaping
Indicates whether or not text shaping determination is required when text is rendered. This is relevant for Arabic scripts, since characters assume different shapes (initial, medial, final, or isolated) according to their position in a word and the connectivity traits of the surrounding characters.

Symmetric swapping
In bidi text, this Indicates whether or not specific directional pairs of characters, such as left and right parentheses, and greater-than and less-than signs, will have to be interchanged in order to preserve the logical meaning of the presented text

Numeral shapes
Indicates whether or not numbers embedded in an Arabic script will have to be presented using the Hindi (or European) digit shapes or the Hindi (or Arabic-Indic) digit shapes.

No single combination of possible values of bidirectional layout attributes is predominant. Existing applications process data with different possible combinations of these values, so it is important that the application know what the associated text attributes are when a Bidirectional data stream is passed.

Layout transformations
Bidi text is stored and processed in different environments in different bidi layouts. To transform between different layouts, layout transformation functions (also called layout functions or layout services functions) are required. These layout services functions have been formally defined and are implemented in IBM operating systems such as IBM AIX. More information is available through the Open Group Technical Standard: Portable Layout Services: Context-dependent and Directional Text document, which can be found at this URL: