pub struct WispTextStyle {
pub font: WispFontHandle,
pub size_ndc: f32,
pub color: Color,
pub line_height: f32,
pub letter_spacing_ndc: f32,
pub weight: WispFontWeight,
pub style: WispFontStyle,
pub align: WispTextAlign,
}Expand description
Style applied to a WispText. Pure data — no third-party types.
Fields§
§font: WispFontHandleFont selection.
size_ndc: f32Size in NDC units (e.g. 0.06 ≈ 6% of canvas height).
color: ColorSolid fill color.
line_height: f32Line height as a multiple of size_ndc. 1.2 is comfortable
for body copy; 1.0 is tight.
letter_spacing_ndc: f32Letter spacing in NDC units (positive = wider).
weight: WispFontWeightFont weight.
style: WispFontStyleItalic / normal.
align: WispTextAlignHorizontal alignment within the layout box.
Implementations§
Source§impl WispTextStyle
impl WispTextStyle
Sourcepub fn with_font(self, font: WispFontHandle) -> Self
pub fn with_font(self, font: WispFontHandle) -> Self
Builder — set the font.
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Builder — set the fill color.
Sourcepub fn with_weight(self, weight: WispFontWeight) -> Self
pub fn with_weight(self, weight: WispFontWeight) -> Self
Builder — set the weight.
Sourcepub fn with_align(self, align: WispTextAlign) -> Self
pub fn with_align(self, align: WispTextAlign) -> Self
Builder — set alignment.
Trait Implementations§
Source§impl Clone for WispTextStyle
impl Clone for WispTextStyle
Source§fn clone(&self) -> WispTextStyle
fn clone(&self) -> WispTextStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WispTextStyle
impl Debug for WispTextStyle
Source§impl Default for WispTextStyle
impl Default for WispTextStyle
Source§impl PartialEq for WispTextStyle
impl PartialEq for WispTextStyle
Source§fn eq(&self, other: &WispTextStyle) -> bool
fn eq(&self, other: &WispTextStyle) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for WispTextStyle
impl StructuralPartialEq for WispTextStyle
Auto Trait Implementations§
impl Freeze for WispTextStyle
impl RefUnwindSafe for WispTextStyle
impl Send for WispTextStyle
impl Sync for WispTextStyle
impl Unpin for WispTextStyle
impl UnsafeUnpin for WispTextStyle
impl UnwindSafe for WispTextStyle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().