Struct floem_cosmic_text::Attrs
source · pub struct Attrs<'a> {
pub color: Color,
pub family: &'a [FamilyOwned],
pub monospaced: bool,
pub stretch: Stretch,
pub style: Style,
pub weight: Weight,
pub font_size: f32,
pub line_height: LineHeightValue,
pub metadata: usize,
}
Expand description
Text attributes
Fields§
§color: Color
§family: &'a [FamilyOwned]
§monospaced: bool
§stretch: Stretch
§style: Style
§weight: Weight
§font_size: f32
§line_height: LineHeightValue
§metadata: usize
Implementations§
source§impl<'a> Attrs<'a>
impl<'a> Attrs<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new set of attributes with sane defaults
This defaults to a regular Sans-Serif font.
sourcepub fn family(self, family: &'a [FamilyOwned]) -> Self
pub fn family(self, family: &'a [FamilyOwned]) -> Self
Set Family
sourcepub fn monospaced(self, monospaced: bool) -> Self
pub fn monospaced(self, monospaced: bool) -> Self
Set monospaced
sourcepub fn raw_weight(self, weight: u16) -> Self
pub fn raw_weight(self, weight: u16) -> Self
Set Weight from u16 value
sourcepub fn line_height(self, line_height: LineHeightValue) -> Self
pub fn line_height(self, line_height: LineHeightValue) -> Self
Set line height
sourcepub fn compatible(&self, other: &Self) -> bool
pub fn compatible(&self, other: &Self) -> bool
Check if this set of attributes can be shaped with another
Trait Implementations§
source§impl<'a> PartialEq for Attrs<'a>
impl<'a> PartialEq for Attrs<'a>
impl<'a> Copy for Attrs<'a>
impl<'a> Eq for Attrs<'a>
Auto Trait Implementations§
impl<'a> Freeze for Attrs<'a>
impl<'a> RefUnwindSafe for Attrs<'a>
impl<'a> Send for Attrs<'a>
impl<'a> Sync for Attrs<'a>
impl<'a> Unpin for Attrs<'a>
impl<'a> UnwindSafe for Attrs<'a>
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