pub struct LayoutOptions {
pub alignment: TextAlignment,
pub flow_direction: FlowDirection,
pub truncation: Option<TruncationMode>,
pub tab_stops: TabStops,
pub paragraph_spacing: f32,
pub hanging_punctuation: bool,
pub decoration: Option<TextDecoration>,
pub inline_objects: Vec<InlineObject>,
}Expand description
Comprehensive layout options for a single layout pass.
Construct via LayoutOptions::builder() for a fluent API, or create
directly and use Default for the standard left-aligned horizontal flow.
Fields§
§alignment: TextAlignmentHorizontal text alignment within the line box.
flow_direction: FlowDirectionText flow direction (horizontal or vertical).
truncation: Option<TruncationMode>Truncation configuration; None disables truncation.
tab_stops: TabStopsTab stop configuration.
paragraph_spacing: f32Extra vertical space (in pixels) inserted between paragraphs when using
crate::engine::LayoutEngine::layout_paragraphs.
hanging_punctuation: boolWhen true, CJK fullwidth punctuation at the start or end of a line is
allowed to overhang (“hang”) into the margin by half its advance width.
This is the CSS hanging-punctuation: allow-end behaviour from CSS Text
Module Level 3 §3. Affects crate::engine::LayoutEngine::layout_with_options.
decoration: Option<TextDecoration>Optional text decoration to apply to all rendered runs.
When set, crate::engine::LayoutEngine::layout_with_options computes
oxitext_core::DecorationRects for every line and stores them in
crate::engine::LayoutResult::decorations.
inline_objects: Vec<InlineObject>Inline objects to be positioned during layout.
Each oxitext_core::InlineObject is appended after the shaped glyphs
on the last line, advancing the cursor by object.advance for each.
Implementations§
Source§impl LayoutOptions
impl LayoutOptions
Sourcepub fn builder() -> LayoutOptionsBuilder
pub fn builder() -> LayoutOptionsBuilder
Returns a new LayoutOptionsBuilder initialised with the defaults.
Trait Implementations§
Source§impl Clone for LayoutOptions
impl Clone for LayoutOptions
Source§fn clone(&self) -> LayoutOptions
fn clone(&self) -> LayoutOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutOptions
impl Debug for LayoutOptions
Auto Trait Implementations§
impl Freeze for LayoutOptions
impl RefUnwindSafe for LayoutOptions
impl Send for LayoutOptions
impl Sync for LayoutOptions
impl Unpin for LayoutOptions
impl UnsafeUnpin for LayoutOptions
impl UnwindSafe for LayoutOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more