pub struct Attrs<'a> {
pub color_opt: Option<Color>,
pub family: Family<'a>,
pub stretch: Stretch,
pub style: Style,
pub weight: Weight,
pub metadata: usize,
pub cache_key_flags: CacheKeyFlags,
pub metrics_opt: Option<CacheMetrics>,
pub letter_spacing_opt: Option<LetterSpacing>,
}
Expand description
Text attributes
Fields§
§color_opt: Option<Color>
§family: Family<'a>
§stretch: Stretch
§style: Style
§weight: Weight
§metadata: usize
§cache_key_flags: CacheKeyFlags
§metrics_opt: Option<CacheMetrics>
§letter_spacing_opt: Option<LetterSpacing>
Letter spacing (tracking) in EM
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 cache_key_flags(self, cache_key_flags: CacheKeyFlags) -> Self
pub fn cache_key_flags(self, cache_key_flags: CacheKeyFlags) -> Self
Set CacheKeyFlags
Sourcepub fn letter_spacing(self, letter_spacing: f32) -> Self
pub fn letter_spacing(self, letter_spacing: f32) -> Self
Set letter spacing (tracking) in EM
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> From<Attrs<'a>> for FontMatchAttrs
impl<'a> From<Attrs<'a>> for FontMatchAttrs
impl<'a> Copy for Attrs<'a>
impl<'a> Eq for Attrs<'a>
impl<'a> StructuralPartialEq 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