pub struct RichTextSpan {
pub text: String,
pub font_size: Option<f64>,
pub font_family: Option<String>,
pub font_weight: Option<String>,
pub font_style: Option<String>,
pub text_color: Option<(u8, u8, u8)>,
pub underline: bool,
pub line_through: bool,
pub baseline_shift: f64,
}Expand description
A span of rich text with per-span style overrides.
XFA Spec 3.3 §4.2.7 (p155) — <exData contentType="text/html"> stores
XHTML content with inline CSS. Each span carries its own formatting
(font, color, weight, etc.) that overrides the node-level defaults.
Fields§
§text: StringText content.
font_size: Option<f64>Font size.
font_family: Option<String>Font family.
font_weight: Option<String>Font weight.
font_style: Option<String>Font style.
text_color: Option<(u8, u8, u8)>Text color.
underline: boolUnderline flag.
line_through: boolLine-through flag.
baseline_shift: f64Vertical shift of the baseline, as a fraction of the font size.
Positive is up (<sup>), negative is down (<sub>), 0.0 is plain.
A fraction rather than an absolute measure, so the shift scales with the
font size – otherwise a superscript in 8pt text would sit as high as one
in 24pt text.
Added for #151: <sub> and <sup> were silently ignored. The text
stayed, the meaning went – and in legal and scientific forms that is the
difference between a footnote marker and an ordinary number.
Trait Implementations§
Source§impl Clone for RichTextSpan
impl Clone for RichTextSpan
Source§fn clone(&self) -> RichTextSpan
fn clone(&self) -> RichTextSpan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more