Skip to main content

BlockLayoutParams

Struct BlockLayoutParams 

Source
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: String

List marker text (e.g., “1.”, “•”, “a)”). Empty if not a list item.

§list_indent: f32

Additional 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: bool

If 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.