Layout transformations and attributes

Enabling bidirectional scripts calls for special attention to:

Text layout

Bidirectional text can have different layouts. A layout differs according to the segments used in the text, and also in the case of Arabic script, it also differs in the shaping of characters and the numerical shapes used. Transformations between the different layouts require transformation functions, also called layout functions or layout services functions.

Layout attributes

To define the characteristics of a bidirectional text layout, a set of attributes is needed. Bidirectional attributes are needed to ascertain the actual layout of text is and how it should be transformed. These attributes are usually external to the text and are stored in an external resource file. The five bidirectional attributes are:

Orientation
Orientation designates the boundary of the presentation area, (window, frame, page), where the writing of the bidirectional text starts. This designation is based on the directionality of the first character in the text. The directionality can be right to left, left to right, or contextual.)

Text type
Text type designates the kind of algorithm used when transforming the text layout. There are three types of algorithms that can be used: visual, implicit, or explicit. A visual algorithm copies entire lines of text as they appear regardless of existing embedded directional segments. An implicit algorithm recognizes directional segments based on the natural directionality of the characters, (for example, right to left for Arabic and left to right for English), and preforms segment inversions accordingly. An explicit algorithm recognizes directional segments and performs inversions based on visual, explicit, and directional controls embedded in the text.

Text shaping
Text shaping is important for Arabic scripts where characters assume different shapes according to their position in a word as well as the connectivity traits of the surrounding characters.

Symmetric shaping
Symmetric shaping designates when specific characters such as (, >, [, { need to be interchanged with ), <, ], } in order to preserve the logical meaning of the presented text.

Numeral shapes
Numeral shapes designates whether the numbers embedded in an Arabic script have to be presented using the European digit shapes 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. Therefore, when a bidirectional data stream is passed to an application, it is important that the application can recognize the associated text attributes.

Layout transformations

Bidirectional text is stored and processed in different environments (platforms) and in different layouts. In order to create a transformation from one layout to another, layout transformation functions are required. WebSphere Business Integration products use layout transformation functions that are based on the Unicode BiDi Algorithm. This algorithm can be found at:

http://www.unicode.org/reports/tr9/)

and are implemented in IBM Java SDK 1.4.1:

http://www-106.ibm.com/developmentworks/java/jdk/bidirectional/JAVABIDI.htm

Copyright IBM Corp. 1997, 2004