Struct swash::Attributes
source · pub struct Attributes(pub u32);
Expand description
Primary attributes for font classification: stretch, weight and style.
This struct is created by the attributes
method on FontRef
.
Tuple Fields§
§0: u32
Implementations§
source§impl Attributes
impl Attributes
sourcepub const fn new(stretch: Stretch, weight: Weight, style: Style) -> Self
pub const fn new(stretch: Stretch, weight: Weight, style: Style) -> Self
Creates new font attributes from the specified stretch, weight and style.
sourcepub fn from_font<'a>(font: &FontRef<'a>) -> Self
pub fn from_font<'a>(font: &FontRef<'a>) -> Self
Extracts the attributes from the specified font.
sourcepub fn has_variations(&self) -> bool
pub fn has_variations(&self) -> bool
Returns true if the font has variations corresponding to primary attributes.
sourcepub fn has_stretch_variation(&self) -> bool
pub fn has_stretch_variation(&self) -> bool
Returns true if the font has a variation for the stretch attribute.
sourcepub fn has_weight_variation(&self) -> bool
pub fn has_weight_variation(&self) -> bool
Returns true if the font has a variation for the weight attribute.
sourcepub fn has_oblique_variation(&self) -> bool
pub fn has_oblique_variation(&self) -> bool
Returns true if the font has a variation for the oblique style attribute.
sourcepub fn has_italic_variation(&self) -> bool
pub fn has_italic_variation(&self) -> bool
Returns true if the font has a variation for the italic style attribute.
sourcepub fn synthesize(&self, requested: Attributes) -> Synthesis
pub fn synthesize(&self, requested: Attributes) -> Synthesis
Returns a synthesis analysis based on the requested attributes with respect to this set of attributes.
Trait Implementations§
source§impl Clone for Attributes
impl Clone for Attributes
source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
1.0.0 · 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 Attributes
impl Debug for Attributes
source§impl Default for Attributes
impl Default for Attributes
source§impl Display for Attributes
impl Display for Attributes
source§impl From<()> for Attributes
impl From<()> for Attributes
source§impl From<Stretch> for Attributes
impl From<Stretch> for Attributes
source§impl From<Style> for Attributes
impl From<Style> for Attributes
source§impl From<Weight> for Attributes
impl From<Weight> for Attributes
source§impl Hash for Attributes
impl Hash for Attributes
source§impl PartialEq for Attributes
impl PartialEq for Attributes
impl Copy for Attributes
impl Eq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)