Compartir a través de


RightToLeftText Class

Defines the RightToLeftText Class.When the object is serialized out as xml, its qualified name is w:rtl.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.OnOffType
        DocumentFormat.OpenXml.Wordprocessing.RightToLeftText

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class RightToLeftText _
    Inherits OnOffType
'Usage
Dim instance As RightToLeftText
public class RightToLeftText : OnOffType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.3.2.30 rtl (Right To Left Text)

This element specifies whether the contents of this run shall have right-to-left characteristics. Specifically, the following behaviors are applied when this element’s val attribute is true (or an equivalent):

  • Formatting – When the contents of this run are displayed, all characters shall be treated as complex script characters. This means that the values of the bCs element (§17.3.2.2) and the iCs element (§17.3.2.17) shall be use to determine bold and italic formatting, that the cs/cstheme attributes on the rFonts element (§17.3.2.26) shall be used to determine the font face, and the szCs element (§17.3.2.39) shall be used to determine the font size.

  • Character Directionality Override – When the contents of this run are displayed, this property acts as a right-to-left override for characters which are classified as follows (using the Unicode Character Database):

Weak types except European Number, European Number Terminator, Common Number Separator, Arabic Number and (for Hebrew text) European Number Separator when constituting part of a number

Neutral types

  • [Rationale: This override allows applications to store and utilize higher-level information beyond that implicitly derived from the Unicode Bidirectional algorithm. For example, if the string “first second” appears in a right-to-left paragraph inside a document, the Unicode algorithm would always result in “first second” at display time (since the neutral character is surrounded by strongly classified characters). However, if the whitespace was entered using a right-to-left input method (e.g. a Hebrew keyboard), then that character could be classified as RTL using this property, allowing the display of “second first” in a right-to-left paragraph, since the user explicitly asked for the space in a right-to-left context. end rationale]

This element provides information used to resolve the (Unicode) classifications of individual characters as either L, R, AN or EN. Once this is determined, the line should be displayed subject to the recommendation of the Unicode BiDi algorithm in reordering resolved levels.

This property shall not be used with strongly left-to-right text. Any behavior under that condition is unspecified. . This property, when off, shall not be used with strong right-to-left text. Any behavior under that condition is unspecified.

If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then right to left characteristics shall not be applied to the contents of this run.

[Example: Consider the following WordprocessingML visual content: “first second, أولى ثاني”. This content might appear as follows within its parent paragraph:

<w:p>
<w:r>
<w:t xml:space="preserve">first second, </w:t>
</w:r>
<w:r>
<w:rPr>
<w:rtl/>
</w:rPr>
<w:t>أولى</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rtl/>
</w:rPr>
<w:t xml:space="preserve"> </w:t>
</w:r>
<w:r>
<w:rPr>
<w:rtl/>
</w:rPr>
<w:t>ثاني</w:t>
</w:r>
</w:p>

The presence of the rtl element on the second, third, and fourth runs specifies that:

  • The formatting on those runs is specified using the complex-script property variants.

  • The whitespace character is treated as right-to-left.

Note that the second, third and fourth runs could be joined as one run with the rtl element specified.

end example]

Parent Elements

rPr (§17.3.1.29); rPr (§17.3.1.30); rPr (§17.5.2.28); rPr (§17.9.25); rPr (§17.7.9.1); rPr (§17.7.5.4); rPr (§17.3.2.28); rPr (§17.5.2.27); rPr (§17.7.6.2); rPr (§17.3.2.27)

This element’s content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

RightToLeftText Members

DocumentFormat.OpenXml.Wordprocessing Namespace