I.3 WordprocessingML
Within the context of a word processing document, additional bidirectional support is specifically applicable, and is described below.
At the section level in WordprocessingML, the bidi element (see 17.6.1) specifies that the section is right-to-left. This affects the orientation of section level properties; the layout of the content within the
section is directly controlled as described below. For example, if the section has multiple columns, the flow of text within those columns is right-to-left.
The section also specifies the rtlGutter element (see 17.6.16), which places the page gutter margin on the right side of a group of pages; this ensure that if bound, the booklet can be read from right-to-left.
At the table level, the bidiVisual element (see 17.4.1) specifies the order in which the cells in the table are processed; either left-to-right or right-to-left (the syntactic model of tables stores the cells logically in the WordprocessingML, irrespective of the desired display order). This does not affect the direction of the text within the cells, but the visual order in which the cells are displayed. Individual table cell properties (e.g. the start and end border are applied based on the display order set by this element.
At the run level, the following properties are used to control direction:
Element
Section
Description
dir
Specifies an increase in the embedding level as described by the Bidirectional Unicode Algorithm (See Unicode Technical Report #9). This element can be nested and will cause the bidi levels to increase following the direction of the embedding. The rtl element within the embedding continues to provide classification resolution, but at the level reached by the dir embedding.
Example: A left-to-right paragraph that has a quote in a right-to-left language, but the quote itself includes left-to-right text. In this case, the text layout within the quote should be read from right-to-left. Adding the “dir” element around the quote will result in the desired layout. (Assume the lower-case text is English and the upper-case text is Arabic or Hebrew.)
Element
Section
Description
The alternating RTL and LTR elements help in resolving the classification of characters within this run as follows:
But the fact that the quote is enclosed in an RTL embedding; the following bidi levels will be generated:
This generates the following text layout:
bdo
17.3.2.3
This element forces a direction override for the enclosed text as described by the Bidirectional Algorithm (see Unicode Technical Report #9). For example, the right-to-left override can be used to force a product part number made of mixed English, digits, and Hebrew text written from right-to-left. (Assume the lower- case text is English and the upper-case text is Arabic or Hebrew.)
This generates the following text layout:
bCs
17.3.2.2
Specifies the bold property for a complex script run of characters, this is applied when the “rtl” element is specified on a run. It is forced when the “cs” element is specified (see the “cs” element later in this table).
iCs
17.3.2.17
Specifies the italic property for a complex script run of characters, this is applied when the “rtl” element is specified on a run. It is forced when the “cs” element is specified (see the “cs” element later in this table).
szCs
17.3.2.39
Specifies the font size property for a complex script run of characters, this is applied when the “rtl” element is specified on a run. It is forced when the “cs”
Element
Section
Description
rFonts
17.3.2.26
element is specified (see the “cs” element later in this table).
Specifies the font to be used for a run of characters. The complex script font is used to render runs with strong bidirectional characters or weak and neutrals marked with the rtl element.
Within the context of a spreadsheet document, additional bidirectional support is specifically applicable, and is described below.
At the sheet view level in SpreadsheetML, the rightToLeft attribute (see 18.3.1.87) sets the sheet direction, i.e/ whether the columns progress from left-to-right, where column A is to the far left of the worksheet, or right-to-left, where column A is to the far right of the worksheet. This attribute does not affect the direction of the cells within the sheet (covered below). In addition, the location of objects within the sheet will be mirrored, but their content will not.
A
B
C
C
B
A
LTR cell
LTR cell
RTL cell
RTL cell
<... rightToLeft = “0” …>
Left-to-right spreadsheet
Note:
Right-to-left spreadsheet
Objects location in the sheet were mirrored Cell direction and alignment are not affected by this element
At the cell level in SpreadsheetML, the readingOrder attribute (see 18.8.1) indicates the baseline direction of all the paragraphs within the cell, which can be set to left-to-right, right-to-left, or context dependent. The latter will scan the text for the first non-whitespace character, and if it is a strong right- to-left character it sets a right-to-left direction for the cell; otherwise, the cell direction is set as left-to- right.
Within cell text, which is optimized for use in calculation logic, the following rules should be followed:
The bidirectional algorithm, as recommended by Unicode UAX#9, should be used to display text. Text copied from WordprocessingML or DrawingML should be processed by an application, which should add Unicode markers to preserve the order of text.
object
object