pub struct DocxHeadingStyle {
pub size_half_points: Option<usize>,
pub bold: bool,
pub italic: bool,
pub alignment: Option<Alignment>,
pub space_before_twips: Option<i32>,
pub space_after_twips: Option<i32>,
pub keep_with_next: bool,
pub page_break_before: bool,
}Expand description
How one HeadingN paragraph style is defined in the output.
Paragraphs carrying a heading level reference a style id (Heading1…Heading6), and a
referenced-but-undefined id is not an error in OOXML — the reader silently substitutes its
own built-in. That is why an export could ask for a 24 pt centred chapter title and open
as whatever Word felt like: nothing in the file ever said what Heading1 is.
Fields§
§size_half_points: Option<usize>Size in half-points (24 = 12 pt). None ⇒ the document’s body size.
bold: bool§italic: bool§alignment: Option<Alignment>Paragraph alignment. None ⇒ inherit (left, or right in an RTL paragraph).
space_before_twips: Option<i32>Space above, in twips (pt × 20).
space_after_twips: Option<i32>Space below, in twips.
keep_with_next: boolKeep the heading on the same page as what follows it, so a chapter title can never be left stranded alone at the foot of a page.
page_break_before: boolStart the heading on a new page. This is the style-level rule (“every heading at
this level opens a page”); a single block can also ask for it through
Block::fmt_page_break_before, and either one is enough.
Implementations§
Source§impl DocxHeadingStyle
impl DocxHeadingStyle
Sourcepub fn default_ramp(body_half_points: usize) -> Vec<DocxHeadingStyle>
pub fn default_ramp(body_half_points: usize) -> Vec<DocxHeadingStyle>
The conventional six-level ramp, scaled off body_half_points: each level a little
smaller than the one above, bold, opening with space and never orphaned from its text.
Deliberately close to what a reader’s own built-in headings look like, because this
exists to make the file say what it was already silently relying on.
Trait Implementations§
Source§impl Clone for DocxHeadingStyle
impl Clone for DocxHeadingStyle
Source§fn clone(&self) -> DocxHeadingStyle
fn clone(&self) -> DocxHeadingStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more