ParagraphFormat
struct · ferroui-controls · v0.5.0
struct ParagraphFormat
Paragraph formatting and inherited character defaults, represented as a patch.
Members
charactertext_alignmentline_heightline_stacking_strategytext_indentmarginflow_directionline_spacing_ruleline_spacingleft_indentright_indenttab_stopsdefault_tab_stopfrom_paragrapheffectiveadd_tabclear_all_tabsdelete_tabtab_countget_tabset_indentsget_indentsset_line_spacingget_line_spacingvalidateoverlaytry_apply_to
character
character: CharacterFormat
text_alignment
text_alignment: Option<ferroui_base::media::TextAlignment>
line_height
line_height: Option<f64>
line_stacking_strategy
line_stacking_strategy: Option<super::LineStackingStrategy>
text_indent
text_indent: Option<f64>
margin
margin: Option<ferroui_base::Thickness>
flow_direction
flow_direction: Option<ferroui_base::media::FlowDirection>
line_spacing_rule
line_spacing_rule: Option<super::LineSpacingRule>
line_spacing
line_spacing: Option<f64>
left_indent
left_indent: Option<f64>
right_indent
right_indent: Option<f64>
tab_stops
tab_stops: Option<super::TextTabStops>
default_tab_stop
default_tab_stop: Option<f64>
from_paragraph
fn from_paragraph(paragraph: &Paragraph) -> Self
effective
fn effective(paragraph: &Paragraph) -> Self
Captures resolved paragraph and inherited character values for format queries.
add_tab
fn add_tab(self: &mut Self, position: f64, alignment: TabAlignment, leader: TabLeader) -> Result<(), super::DocumentError>
Adds or replaces an explicit tab. TOM positions are points; paragraph properties, snapshots and the formatter retain layout units (96 per inch).
clear_all_tabs
fn clear_all_tabs(self: &mut Self)
Removes explicit tabs; default equally spaced stops remain active.
delete_tab
fn delete_tab(self: &mut Self, position: f64) -> Result<(), super::DocumentError>
tab_count
fn tab_count(self: &Self) -> usize
get_tab
fn get_tab(self: &Self, index: usize) -> Result<(f64, TabAlignment, TabLeader), super::DocumentError>
Zero-based explicit tab query; positions are returned in TOM points.
set_indents
fn set_indents(self: &mut Self, first: f64, left: f64, right: f64) -> Result<(), super::DocumentError>
Sets TOM indentation in points. Negative values are valid; paragraph margins remain nonnegative layout spacing and are stored separately.
get_indents
fn get_indents(self: &Self) -> (f64, f64, f64)
Returns first-line, left, and right indentation in TOM points.
set_line_spacing
fn set_line_spacing(self: &mut Self, rule: LineSpacingRule, spacing: f64) -> Result<(), super::DocumentError>
Sets the TOM line spacing in points, converting absolute distances to layout units. Multipliers and percentages retain their native units.
get_line_spacing
fn get_line_spacing(self: &Self) -> (LineSpacingRule, f64)
Returns the TOM rule and value; absolute distances are returned in points.
validate
fn validate(self: &Self) -> Result<(), super::DocumentError>
overlay
fn overlay(self: &Self, patch: &Self) -> Self
try_apply_to
fn try_apply_to(self: &Self, paragraph: &Paragraph) -> Result<(), super::DocumentError>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherCloneDebugDefaultPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.