pub struct OdtHeadingStyle {
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 heading level’s paragraph style is defined in the output.
The ODF analog of super::docx_options::DocxHeadingStyle — same fields, same reasoning:
a <text:h text:outline-level="N"> carries its level as an explicit attribute (so, unlike
OOXML, a reader never has to guess the level from a style name), but what that heading
looks like — size, weight, spacing, whether it starts a new page — still has to be said
somewhere, or every heading opens looking like plain body text with a reader’s arbitrary
built-in substituted in its place.
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. Emitted as fo:keep-with-next="always".
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 OdtHeadingStyle
impl OdtHeadingStyle
Sourcepub fn default_ramp(body_half_points: usize) -> Vec<OdtHeadingStyle>
pub fn default_ramp(body_half_points: usize) -> Vec<OdtHeadingStyle>
The conventional six-level ramp, scaled off body_half_points — byte-for-byte the
same numbers super::docx_options::DocxHeadingStyle::default_ramp produces, so a
document exported to both DOCX and ODT with default options looks the same in either
reader. 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 OdtHeadingStyle
impl Clone for OdtHeadingStyle
Source§fn clone(&self) -> OdtHeadingStyle
fn clone(&self) -> OdtHeadingStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more