[][src]Struct msoffice_shared::drawingml::TextParagraphProperties

pub struct TextParagraphProperties {
    pub margin_left: Option<TextMargin>,
    pub margin_right: Option<TextMargin>,
    pub level: Option<TextIndentLevelType>,
    pub indent: Option<TextIndent>,
    pub align: Option<TextAlignType>,
    pub default_tab_size: Option<Coordinate32>,
    pub rtl: Option<bool>,
    pub east_asian_line_break: Option<bool>,
    pub font_align: Option<TextFontAlignType>,
    pub latin_line_break: Option<bool>,
    pub hanging_punctuations: Option<bool>,
    pub line_spacing: Option<TextSpacing>,
    pub space_before: Option<TextSpacing>,
    pub space_after: Option<TextSpacing>,
    pub bullet_color: Option<TextBulletColor>,
    pub bullet_size: Option<TextBulletSize>,
    pub bullet_typeface: Option<TextBulletTypeface>,
    pub bullet: Option<TextBullet>,
    pub tab_stop_list: Option<Vec<TextTabStop>>,
    pub default_run_properties: Option<Box<TextCharacterProperties>>,
}

Fields

margin_left: Option<TextMargin>

Specifies the left margin of the paragraph. This is specified in addition to the text body inset and applies only to this text paragraph. That is the text body inset and the marL attributes are additive with respect to the text position. If this attribute is omitted, then a value of 347663 is implied.

margin_right: Option<TextMargin>

Specifies the right margin of the paragraph. This is specified in addition to the text body inset and applies only to this text paragraph. That is the text body inset and the marR attributes are additive with respect to the text position. If this attribute is omitted, then a value of 0 is implied.

level: Option<TextIndentLevelType>

Specifies the particular level text properties that this paragraph follows. The value for this attribute is numerical and formats the text according to the corresponding level paragraph properties that are listed within the lstStyle element. Since there are nine separate level properties defined, this tag has an effective range of 0-8 = 9 available values.

Xml example

Consider the following DrawingML. This would specify that this paragraph should follow the lvl2pPr formatting style because once again lvl="1" is considered to be level 2.

<p:txBody>
  …
  <a:p>
    <a:pPr lvl="1" …/>
    …
    <a:t>Sample text</a:t>
    …
  </a:p>
</p:txBody>

Note

To resolve conflicting paragraph properties the linear hierarchy of paragraph properties should be examined starting first with the pPr element. The rule here is that properties that are defined at a level closer to the actual text should take precedence. That is if there is a conflicting property between the pPr and lvl1pPr elements then the pPr property should take precedence because in the property hierarchy it is closer to the actual text being represented.

indent: Option<TextIndent>

Specifies the indent size that is applied to the first line of text in the paragraph. An indentation of 0 is considered to be at the same location as marL attribute. If this attribute is omitted, then a value of -342900 is implied.

Xml example

Consider the scenario where the user now wanted to add a paragraph indentation to the first line of text in their two column format book.

<p:txBody>
  <a:bodyPr numCol="2" spcCol="914400"…/>
    <a:normAutofit/>
  </a:bodyPr>
  …
  <a:p>
    <a:pPr marL="0" indent="571500" algn="just">
      <a:buNone/>
    </a:pPr>
    …
    <a:t>Here is some…</a:t>
    …
  </a:p>
</p:txBody>

By adding the indent attribute the user has effectively added a first line indent to this paragraph of text.

align: Option<TextAlignType>

Specifies the alignment that is to be applied to the paragraph. Possible values for this include left, right, centered, justified and distributed. If this attribute is omitted, then a value of left is implied.

Xml example

Consider the case where the user wishes to have two columns of text that have a justified alignment, much like text within a book. The following DrawingML could describe this.

<p:txBody>
  <a:bodyPr numCol="2" spcCol="914400"…/>
    <a:normAutofit/>
  </a:bodyPr>
  …
  <a:p>
    <a:pPr marL="0" algn="just">
      <a:buNone/>
    </a:pPr>
    …
    <a:t>Sample Text …</a:t>
    …
  </a:p>
</p:txBody>
default_tab_size: Option<Coordinate32>

Specifies the default size for a tab character within this paragraph. This attribute should be used to describe the spacing of tabs within the paragraph instead of a leading indentation tab. For indentation tabs there are the marL and indent attributes to assist with this.

Xml example

Consider the case where a paragraph contains numerous tabs that need to be of a specific size. The following DrawingML would describe this.

<p:txBody>
  …
  <a:p>
    <a:pPr defTabSz="376300" …/>
    …
    <a:t>Sample Text …</a:t>
    …
  </a:p>
</p:txBody>
rtl: Option<bool>

Specifies whether the text is right-to-left or left-to-right in its flow direction. If this attribute is omitted, then a value of 0, or left-to-right is implied.

Xml example

Consider the following example of a text body with two lines of text. In this example, both lines contain English and Arabic text, however, the second line has the rtl attribute set to true whereas the first line does not set the rtl attribute.

<p:txBody>
  …
  <a:p>
    <a:r>
      <a:t>Test </a:t>
    </a:r>
    <a:r>
      <a:rPr>
        <a:rtl w:val="1"/>
      </a:rPr>
      <a:t> تجربة </a:t>
    </a:r>
  </a:p>
  <a:p>
    <a:pPr rtl="1"/>
    <a:r>
      <a:rPr>
        <a:rtl w:val="0"/>
      </a:rPr>
      <a:t>Test </a:t>
    </a:r>
    <a:r>
      <a:t> تجربة </a:t>
    </a:r>
  </a:p>
</p:txBody>
east_asian_line_break: Option<bool>

Specifies whether an East Asian word can be broken in half and wrapped onto the next line without a hyphen being added. To determine whether an East Asian word can be broken the presentation application would use the kinsoku settings here. This attribute is to be used specifically when there is a word that cannot be broken into multiple pieces without a hyphen. That is it is not present within the existence of normal breakable East Asian words but is when a special case word arises that should not be broken for a line break. If this attribute is omitted, then a value of 1 or true is implied.

Xml example

Consider the case where the presentation contains a long word that must not be divided with a line break. Instead it should be placed, in whole on a new line so that it can fit. The picture below shows a normal paragraph where a long word has been broken for a line break. The second picture shown below shows that same paragraph with the long word specified to not allow a line break. The resulting DrawingML is as follows.

<p:txBody>
  …
  <a:p>
    <a:pPr eaLnBrk="0" …/>
    …
    <a:t>Sample text (Long word)</a:t>
    …
  </a:p>
</p:txBody>
font_align: Option<TextFontAlignType>

Determines where vertically on a line of text the actual words are positioned. This deals with vertical placement of the characters with respect to the baselines. For instance having text anchored to the top baseline, anchored to the bottom baseline, centered in between, etc. To understand this attribute and it's use it is helpful to understand what baselines are. A diagram describing these different cases is shown below. If this attribute is omitted, then a value of base is implied.

Xml example

Consider the case where the user wishes to represent the chemical compound of a water molecule. For this they need to make sure the H, the 2, and the O are all in the correct position and are of the correct size. The results below can be achieved through the DrawingML shown below.

<a:txtBody>
  …
  <a:pPr fontAlgn="b" …/>
  …
  <a:r>
    <a:rPr …/>
    <a:t>H </a:t>
  </a:r>
  <a:r>
    <a:rPr sz="1200" …/>
    <a:t>2</a:t>
  </a:r>
  <a:r>
    <a:rPr …/>
    <a:t>O</a:t>
  </a:r>
  …
</p:txBody>
latin_line_break: Option<bool>

Specifies whether a Latin word can be broken in half and wrapped onto the next line without a hyphen being added. This attribute is to be used specifically when there is a word that cannot be broken into multiple pieces without a hyphen. It is not present within the existence of normal breakable Latin words but is when a special case word arises that should not be broken for a line break. If this attribute is omitted, then a value of 1 or true is implied.

Xml example

Consider the case where the presentation contains a long word that must not be divided with a line break. Instead it should be placed, in whole on a new line so that it can fit. The picture below shows a normal paragraph where a long word has been broken for a line break. The second picture shown below shows that same paragraph with the long word specified to not allow a line break. The resulting DrawingML is as follows.

<p:txBody>
  …
  <a:p>
    <a:pPr latinLnBrk="0" …/>
    …
    <a:t>Sample text (Long word)</a:t>
    …
  </a:p>
</p:txBody>
hanging_punctuations: Option<bool>

Specifies whether punctuation is to be forcefully laid out on a line of text or put on a different line of text. That is, if there is punctuation at the end of a run of text that should be carried over to a separate line does it actually get carried over. A true value allows for hanging punctuation forcing the punctuation to not be carried over and a value of false allows the punctuation to be carried onto the next text line. If this attribute is omitted, then a value of 0, or false is implied.

line_spacing: Option<TextSpacing>

This element specifies the vertical line spacing that is to be used within a paragraph. This can be specified in two different ways, percentage spacing and font point spacing. If this element is omitted then the spacing between two lines of text should be determined by the point size of the largest piece of text within a line.

Xml example

<p:txBody>
  <a:p>
    <a:pPr>
      <a:lnSpc>
        <a:spcPct val="200%"/>
      </a:lnSpc>
    </a:pPr>
    <a:r>
      <a:rPr lang="en-US" dirty="0" smtClean="0"/>
      <a:t>Some</a:t>
    </a:r>
    <a:br>
      <a:rPr lang="en-US" smtClean="0"/>
    </a:br>
    <a:r>
     <a:rPr lang="en-US" dirty="0" smtClean="0"/>
     <a:t>Text</a:t>
    </a:r>
  </a:p>
</p:txBody>

This paragraph has two lines of text that have percentage based vertical spacing. This kind of spacing should change based on the size of the text involved as its size is calculated as a percentage of this.

space_before: Option<TextSpacing>

This element specifies the amount of vertical white space that is present before a paragraph. This space is specified in either percentage or points via the child elements spcPct and spcPts.

Xml example

<p:txBody>
  …
  <a:p>
    <a:pPr …>
      <a:spcBef>
        <a:spcPts val="1800"/>
      </a:spcBef>
      <a:spcAft>
        <a:spcPts val="600"/>
      </a:spcAft>
    </a:pPr>
    …
    <a:t>Sample Text</a:t>
    …
  </a:p>
  …
</p:txBody>

The above paragraph of text is formatted to have a spacing both before and after the paragraph text. The spacing before is a size of 18 points, or value=1800 and the spacing after is a size of 6 points, or value=600.

space_after: Option<TextSpacing>

This element specifies the amount of vertical white space that is present after a paragraph. This space is specified in either percentage or points via the child elements spcPct and spcPts.

Xml example

<p:txBody>
  …
  <a:p>
    <a:pPr …>
      <a:spcBef>
        <a:spcPts val="1800"/>
      </a:spcBef>
      <a:spcAft>
        <a:spcPts val="600"/>
      </a:spcAft>
    </a:pPr>
    …
    <a:t>Sample Text</a:t>
    …
  </a:p>
  …
</p:txBody>

The above paragraph of text is formatted to have a spacing both before and after the paragraph text. The spacing before is a size of 18 points, or value=1800 and the spacing after is a size of 6 points, or value=600.

bullet_color: Option<TextBulletColor>

Specifies the color of the bullet for this paragraph.

bullet_size: Option<TextBulletSize>

Specifies the size of the bullet for this paragraph.

bullet_typeface: Option<TextBulletTypeface>

Specifies the font properties of the bullet for this paragraph.

bullet: Option<TextBullet>

Specifies the bullet's properties for this paragraph.

tab_stop_list: Option<Vec<TextTabStop>>

This element specifies the list of all tab stops that are to be used within a paragraph. These tabs should be used when describing any custom tab stops within the document. If these are not specified then the default tab stops of the generating application should be used.

default_run_properties: Option<Box<TextCharacterProperties>>

This element contains all default run level text properties for the text runs within a containing paragraph. These properties are to be used when overriding properties have not been defined within the rPr element.

Xml example

<a:p>
  …
  <a:rPr u="sng"/>
  …
  <a:t>Some Text</a:t>
  …
</a:p>

The run of text described above is formatting with a single underline of text matching color.

Methods

impl TextParagraphProperties[src]

Trait Implementations

impl Default for TextParagraphProperties[src]

impl Clone for TextParagraphProperties[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for TextParagraphProperties[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]