Struct onenote_parser::contents::RichText
source · pub struct RichText { /* private fields */ }
Expand description
A rich text paragraph.
Formatting
Rich-text formatting is represented by storing the paragraph text along with a list of text runs. Each text run specified formatting that is only applied to a substring of the paragraph text.
The text run indices represent where each text run ends. The last text run always ends at the end of the paragraph text. If there are no text run indices, the text run formatting applies to the whole paragraph.
Text runs can be rendered by splitting the paragraph text at the text run indices and then applying each text run formatting to its respective substring.
Implementations
sourceimpl RichText
impl RichText
sourcepub fn text_run_formatting(&self) -> &[ParagraphStyling]
pub fn text_run_formatting(&self) -> &[ParagraphStyling]
The formatting of each text run.
See [MS-ONE] 2.3.77.
sourcepub fn text_run_indices(&self) -> &[u32]
pub fn text_run_indices(&self) -> &[u32]
The character positions where the text runs end.
See [MS-ONE] 2.3.76.
sourcepub fn paragraph_style(&self) -> &ParagraphStyling
pub fn paragraph_style(&self) -> &ParagraphStyling
The base paragraph style.
sourcepub fn paragraph_space_before(&self) -> f32
pub fn paragraph_space_before(&self) -> f32
The paragraph’s top margin in half-inch increments.
See [MS-ONE] 2.3.81.
sourcepub fn paragraph_space_after(&self) -> f32
pub fn paragraph_space_after(&self) -> f32
The paragraph’s bottom margin in half-inch increments.
See [MS-ONE] 2.3.82.
sourcepub fn paragraph_line_spacing_exact(&self) -> Option<f32>
pub fn paragraph_line_spacing_exact(&self) -> Option<f32>
The paragraph’s line spacing in half-inch increments.
See [MS-ONE] 2.3.83.
sourcepub fn paragraph_alignment(&self) -> ParagraphAlignment
pub fn paragraph_alignment(&self) -> ParagraphAlignment
The paragraph’s text alignment.
See [MS-ONE] 2.3.94.
sourcepub fn layout_alignment_in_parent(&self) -> Option<LayoutAlignment>
pub fn layout_alignment_in_parent(&self) -> Option<LayoutAlignment>
The paragraph’s alignment relative to the containing outline element (if present).
See [MS-ONE] 2.3.27.
sourcepub fn layout_alignment_self(&self) -> Option<LayoutAlignment>
pub fn layout_alignment_self(&self) -> Option<LayoutAlignment>
The paragraph’s alignment.
See [MS-ONE] 2.3.33.
Note tags for this paragraph.
sourcepub fn embedded_objects(&self) -> &[EmbeddedObject]
pub fn embedded_objects(&self) -> &[EmbeddedObject]
Objects embedded in this paragraph.