Skip to main content

TextRunExt

Trait TextRunExt 

Source
pub trait TextRunExt {
    // Required methods
    fn text(&self) -> &str;
    fn is_bold(&self) -> bool;
    fn is_italic(&self) -> bool;
    fn is_underlined(&self) -> bool;
    fn is_strikethrough(&self) -> bool;
    fn font_size(&self) -> Option<i32>;
    fn has_hyperlink(&self) -> bool;
    fn hyperlink_rel_id(&self) -> Option<&str>;
    fn is_all_caps(&self) -> bool;
    fn is_small_caps(&self) -> bool;
    fn language(&self) -> Option<&str>;
    fn baseline_shift_pct(&self) -> Option<i32>;
}
Expand description

Extension trait for TextRun providing convenience methods.

Required Methods§

Source

fn text(&self) -> &str

Get the text content.

Source

fn is_bold(&self) -> bool

Check if the text is bold.

Source

fn is_italic(&self) -> bool

Check if the text is italic.

Source

fn is_underlined(&self) -> bool

Check if the text is underlined.

Source

fn is_strikethrough(&self) -> bool

Check if the text has strikethrough.

Source

fn font_size(&self) -> Option<i32>

Get the font size in hundredths of a point.

Check if the run has a hyperlink.

Get the hyperlink relationship ID.

Source

fn is_all_caps(&self) -> bool

Check if all-caps formatting is set for this run.

Source

fn is_small_caps(&self) -> bool

Check if small-caps formatting is set for this run.

Source

fn language(&self) -> Option<&str>

Get the BCP 47 language tag for this run (e.g. "en-US").

Source

fn baseline_shift_pct(&self) -> Option<i32>

Get the baseline shift as a signed percentage (positive = superscript).

Implementors§

Source§

impl TextRunExt for TextRun

Available on crate feature dml-text only.