Struct embedded_text::style::TextBoxStyleBuilder
source · pub struct TextBoxStyleBuilder { /* private fields */ }
Expand description
TextBoxStyle
builder object.
Implementations§
source§impl TextBoxStyleBuilder
impl TextBoxStyleBuilder
sourcepub const fn line_height(self, line_height: LineHeight) -> Self
pub const fn line_height(self, line_height: LineHeight) -> Self
Sets the line height.
The line height is defined as the vertical distance between the baseline of two adjacent lines of text.
§Example
let style = TextBoxStyleBuilder::new()
.line_height(LineHeight::Pixels(12))
.build();
sourcepub const fn paragraph_spacing(self, paragraph_spacing: u32) -> Self
pub const fn paragraph_spacing(self, paragraph_spacing: u32) -> Self
Sets the paragraph spacing.
§Example
let style = TextBoxStyleBuilder::new()
.paragraph_spacing(0)
.build();
sourcepub const fn alignment(
self,
alignment: HorizontalAlignment
) -> TextBoxStyleBuilder
pub const fn alignment( self, alignment: HorizontalAlignment ) -> TextBoxStyleBuilder
Sets the horizontal text alignment.
sourcepub const fn vertical_alignment(
self,
vertical_alignment: VerticalAlignment
) -> TextBoxStyleBuilder
pub const fn vertical_alignment( self, vertical_alignment: VerticalAlignment ) -> TextBoxStyleBuilder
Sets the vertical text alignment.
sourcepub const fn height_mode(self, height_mode: HeightMode) -> TextBoxStyleBuilder
pub const fn height_mode(self, height_mode: HeightMode) -> TextBoxStyleBuilder
Sets the height mode.
sourcepub const fn leading_spaces(self, render: bool) -> Self
pub const fn leading_spaces(self, render: bool) -> Self
Render leading spaces.
sourcepub const fn trailing_spaces(self, render: bool) -> Self
pub const fn trailing_spaces(self, render: bool) -> Self
Render trailing spaces.
sourcepub const fn build(self) -> TextBoxStyle
pub const fn build(self) -> TextBoxStyle
Builds the TextBoxStyle
.
Trait Implementations§
source§impl Clone for TextBoxStyleBuilder
impl Clone for TextBoxStyleBuilder
source§fn clone(&self) -> TextBoxStyleBuilder
fn clone(&self) -> TextBoxStyleBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TextBoxStyleBuilder
impl Debug for TextBoxStyleBuilder
source§impl From<&TextBoxStyle> for TextBoxStyleBuilder
impl From<&TextBoxStyle> for TextBoxStyleBuilder
source§fn from(style: &TextBoxStyle) -> Self
fn from(style: &TextBoxStyle) -> Self
Converts to this type from the input type.
source§impl Hash for TextBoxStyleBuilder
impl Hash for TextBoxStyleBuilder
source§impl PartialEq for TextBoxStyleBuilder
impl PartialEq for TextBoxStyleBuilder
source§fn eq(&self, other: &TextBoxStyleBuilder) -> bool
fn eq(&self, other: &TextBoxStyleBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for TextBoxStyleBuilder
impl Eq for TextBoxStyleBuilder
impl StructuralPartialEq for TextBoxStyleBuilder
Auto Trait Implementations§
impl Freeze for TextBoxStyleBuilder
impl RefUnwindSafe for TextBoxStyleBuilder
impl Send for TextBoxStyleBuilder
impl Sync for TextBoxStyleBuilder
impl Unpin for TextBoxStyleBuilder
impl UnwindSafe for TextBoxStyleBuilder
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.