pub struct BlockLayoutParams {Show 17 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 line_height_multiplier: Option<f32>,
pub non_breakable_lines: bool,
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.
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.
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.
Auto Trait Implementations§
impl Freeze for BlockLayoutParams
impl RefUnwindSafe for BlockLayoutParams
impl Send for BlockLayoutParams
impl Sync for BlockLayoutParams
impl Unpin for BlockLayoutParams
impl UnsafeUnpin for BlockLayoutParams
impl UnwindSafe for BlockLayoutParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more