pub struct TextStyle {
pub size: f64,
pub color: Color,
pub weight: FontWeight,
pub family: Option<String>,
pub halign: HAlign,
pub valign: VAlign,
}Expand description
Controls how text is rendered: size, color, weight, font, and alignment.
Fields§
§size: f64Font size in device-independent units (points).
color: ColorThe color used to render the glyphs.
weight: FontWeightFont weight (normal or bold).
family: Option<String>Optional font family name (e.g. "Helvetica"). None uses the
renderer’s default.
halign: HAlignHorizontal alignment relative to the anchor point.
valign: VAlignVertical alignment relative to the anchor point.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn new(size: f64) -> TextStyle
pub fn new(size: f64) -> TextStyle
Creates a new text style with the given font size.
Defaults: color Color::BLACK, weight FontWeight::Normal, no
explicit font family, horizontal alignment HAlign::Left, vertical
alignment VAlign::Baseline.
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