pub struct BlockLayoutParams {Show 19 fields
pub block_id: usize,
pub position: usize,
pub text: String,
pub fragments: Vec<FragmentParams>,
pub alignment: Alignment,
pub top_margin: f32,
pub bottom_margin: f32,
pub left_margin: f32,
pub right_margin: f32,
pub text_indent: f32,
pub list_marker: String,
pub list_indent: f32,
pub tab_positions: Vec<f32>,
pub base_direction: TextDirection,
pub line_height_multiplier: Option<f32>,
pub non_breakable_lines: bool,
pub hyphenation: Option<Hyphenation>,
pub checkbox: Option<bool>,
pub background_color: Option<[f32; 4]>,
}Expand description
Parameters extracted from text-document’s BlockFormat / TextFormat. This is a plain struct so block layout doesn’t depend on text-document types.
Fields§
§block_id: usize§position: usize§text: String§fragments: Vec<FragmentParams>§alignment: Alignment§top_margin: f32§bottom_margin: f32§left_margin: f32§right_margin: f32§text_indent: f32§list_marker: StringList marker text (e.g., “1.”, “•”, “a)”). Empty if not a list item.
list_indent: f32Additional left indent for list items (in pixels).
tab_positions: Vec<f32>Tab stop positions in pixels from the left margin.
base_direction: TextDirectionThe paragraph’s base reading direction.
Auto applies UAX #9 rules P2/P3 (first strong character wins).
An explicit direction overrides that, which is what a stored
per-block direction is for: auto-detection reads an Arabic
paragraph opening with a Latin acronym as left-to-right.
Drives three things: which direction each bidi run shapes with,
the visual order of a line’s runs, and — when alignment is
Start/End — which edge the text sits against.
line_height_multiplier: Option<f32>Line height multiplier. 1.0 = normal (from font metrics), 1.5 = 150%, 2.0 = double. None means use font metrics (ascent + descent + leading).
non_breakable_lines: boolIf true, prevent line wrapping. The entire block is one long line.
hyphenation: Option<Hyphenation>Hyphenation during line wrapping (None = off). See
crate::types::Hyphenation.
checkbox: Option<bool>Checkbox marker: None = no checkbox, Some(false) = unchecked, Some(true) = checked.
background_color: Option<[f32; 4]>Block background color (RGBA). None means transparent.
Trait Implementations§
Source§impl Clone for BlockLayoutParams
impl Clone for BlockLayoutParams
Source§fn clone(&self) -> BlockLayoutParams
fn clone(&self) -> BlockLayoutParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more