pub struct TextStyle {
pub font_size: f32,
pub max_width: f32,
pub flow_direction: FlowDirection,
pub alignment: TextAlignment,
pub line_spacing: LineSpacing,
}Expand description
Text rendering style.
Fields§
§font_size: f32Font size in points.
max_width: f32Maximum line width in pixels (0.0 = no wrap).
flow_direction: FlowDirectionText flow direction (horizontal or vertical).
alignment: TextAlignmentHorizontal alignment of laid-out lines.
line_spacing: LineSpacingLine spacing configuration.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn with_alignment(self, alignment: TextAlignment) -> Self
pub fn with_alignment(self, alignment: TextAlignment) -> Self
Returns a copy of this style with the given alignment.
Sourcepub fn with_font_size(self, font_size: f32) -> Self
pub fn with_font_size(self, font_size: f32) -> Self
Returns a copy of this style with the given font size (pixels-per-em).
Sourcepub fn with_max_width(self, max_width: f32) -> Self
pub fn with_max_width(self, max_width: f32) -> Self
Returns a copy of this style with the given maximum line width.
Sourcepub fn with_flow_direction(self, flow_direction: FlowDirection) -> Self
pub fn with_flow_direction(self, flow_direction: FlowDirection) -> Self
Returns a copy of this style with the given flow direction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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