pub struct TextStyle {
pub family: String,
pub size: f32,
pub weight: FontWeight,
pub color: Color,
pub align: TextAlign,
pub baseline: TextBaseline,
pub letter_spacing: f32,
pub line_height: f32,
}Expand description
Text style configuration
Fields§
§family: StringFont family name
size: f32Font size in pixels
weight: FontWeightFont weight
color: ColorText color
align: TextAlignText alignment
baseline: TextBaselineText baseline
letter_spacing: f32Letter spacing adjustment
line_height: f32Line height multiplier
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Set text color
Sourcepub fn with_weight(self, weight: FontWeight) -> Self
pub fn with_weight(self, weight: FontWeight) -> Self
Set font weight
Sourcepub fn with_family(self, family: impl Into<String>) -> Self
pub fn with_family(self, family: impl Into<String>) -> Self
Set font family
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