pub struct LayoutOptionsBuilder(/* private fields */);Expand description
Fluent builder for LayoutOptions.
Implementations§
Source§impl LayoutOptionsBuilder
impl LayoutOptionsBuilder
Sourcepub fn alignment(self, a: TextAlignment) -> Self
pub fn alignment(self, a: TextAlignment) -> Self
Sets the text alignment.
Sourcepub fn flow_direction(self, d: FlowDirection) -> Self
pub fn flow_direction(self, d: FlowDirection) -> Self
Sets the flow direction.
Sourcepub fn truncation(self, t: TruncationMode) -> Self
pub fn truncation(self, t: TruncationMode) -> Self
Enables truncation with the given mode.
Sourcepub fn paragraph_spacing(self, s: f32) -> Self
pub fn paragraph_spacing(self, s: f32) -> Self
Sets the paragraph spacing.
Sourcepub fn hanging_punctuation(self, hp: bool) -> Self
pub fn hanging_punctuation(self, hp: bool) -> Self
Enables or disables hanging punctuation.
When true, CJK fullwidth punctuation at a line’s start/end overhangs
into the margin by half its advance. Defaults to false.
Sourcepub fn decoration(self, d: TextDecoration) -> Self
pub fn decoration(self, d: TextDecoration) -> Self
Sets the text decoration to apply to all lines in the layout.
When set, the layout engine computes oxitext_core::DecorationRects
for each line and stores them in
crate::engine::LayoutResult::decorations.
Sourcepub fn inline_objects(self, objects: Vec<InlineObject>) -> Self
pub fn inline_objects(self, objects: Vec<InlineObject>) -> Self
Sets the inline objects to be positioned during layout.
The objects are appended after the shaped glyphs, advancing the cursor
by each object’s advance width.
Sourcepub fn build(self) -> LayoutOptions
pub fn build(self) -> LayoutOptions
Consumes the builder and returns the final LayoutOptions.
Auto Trait Implementations§
impl Freeze for LayoutOptionsBuilder
impl RefUnwindSafe for LayoutOptionsBuilder
impl Send for LayoutOptionsBuilder
impl Sync for LayoutOptionsBuilder
impl Unpin for LayoutOptionsBuilder
impl UnsafeUnpin for LayoutOptionsBuilder
impl UnwindSafe for LayoutOptionsBuilder
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
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>
Converts
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>
Converts
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