pub struct ParagraphBlock {Show 17 fields
pub lines: Vec<LayoutLine>,
pub anchored: Vec<AnchoredDrawing>,
pub space_before: f64,
pub space_after: f64,
pub borders: Option<CT_PBdr>,
pub shading: Option<Color>,
pub indent_left: f64,
pub indent_right: f64,
pub jc: Option<Align>,
pub keep_next: bool,
pub keep_lines: bool,
pub page_break_before: bool,
pub widow_control: bool,
pub heading_level: Option<u32>,
pub heading_text: Option<String>,
pub reflow: Option<Box<ParagraphReflow>>,
pub content_offset_top: f64,
}Expand description
A laid-out paragraph with its lines and spacing.
Fields§
§lines: Vec<LayoutLine>Laid-out lines.
anchored: Vec<AnchoredDrawing>Floating drawings anchored to this paragraph.
These travel with the paragraph so the paginator can resolve a paragraph-relative or line-relative offset once it knows where the paragraph actually landed.
space_before: f64Space before the paragraph in points.
space_after: f64Space after the paragraph in points.
borders: Option<CT_PBdr>Paragraph borders.
shading: Option<Color>Background shading color.
indent_left: f64Left indent in points.
indent_right: f64Right indent in points.
jc: Option<Align>Paragraph justification.
keep_next: boolKeep with next paragraph.
keep_lines: boolKeep all lines together on one page.
page_break_before: boolForce page break before this paragraph.
widow_control: boolWidow/orphan control.
heading_level: Option<u32>Heading level (1-9) if this is a heading paragraph, for outline generation.
heading_text: Option<String>Heading text for outline generation.
reflow: Option<Box<ParagraphReflow>>Inputs for re-breaking this paragraph around a floating drawing.
None unless the document holds a drawing that wraps.
content_offset_top: f64Vertical space kept clear above the first line, for a drawing this paragraph must clear rather than flow beside.
Implementations§
Source§impl ParagraphBlock
impl ParagraphBlock
Sourcepub fn content_height(&self) -> f64
pub fn content_height(&self) -> f64
Total height of the paragraph lines (not including before/after spacing).
Sourcepub fn total_height(&self) -> f64
pub fn total_height(&self) -> f64
Total height including spacing.
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Number of lines.
Trait Implementations§
Source§impl Clone for ParagraphBlock
impl Clone for ParagraphBlock
Source§fn clone(&self) -> ParagraphBlock
fn clone(&self) -> ParagraphBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more