pub struct FontFamily { /* private fields */ }Expand description
A literal family identity or one of the three host generic preferences.
Implementations§
Source§impl FontFamily
impl FontFamily
Sourcepub fn parse_selection(selection: &str) -> Result<Self>
pub fn parse_selection(selection: &str) -> Result<Self>
Parse one literal family or the case-insensitive native generic preference.
A quoted literal uses \" and \\ escapes; commas never split a selection.
Sourcepub fn selection(&self) -> String
pub fn selection(&self) -> String
A copyable family selection, preserving the original parsed spelling.
Sourcepub fn named(name: impl Into<String>) -> Result<Self>
pub fn named(name: impl Into<String>) -> Result<Self>
Construct a nonempty, already trimmed, control-free literal family name. Punctuation and CSS generic spellings remain part of this one literal name.
Sourcepub const fn generic(family: GenericFontFamily) -> Self
pub const fn generic(family: GenericFontFamily) -> Self
Construct a host generic preference without parsing a string.
Sourcepub const fn generic_family(&self) -> Option<GenericFontFamily>
pub const fn generic_family(&self) -> Option<GenericFontFamily>
Inspect the generic preference, or None for a literal name.
Trait Implementations§
Source§impl Clone for FontFamily
impl Clone for FontFamily
Source§impl Debug for FontFamily
impl Debug for FontFamily
impl Eq for FontFamily
Source§impl From<FontFamily> for FontScope
impl From<FontFamily> for FontScope
Source§fn from(family: FontFamily) -> Self
fn from(family: FontFamily) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for FontFamily
impl Freeze for FontFamily
impl Move for FontFamily
impl RefUnwindSafe for FontFamily
impl Send for FontFamily
impl Sync for FontFamily
impl Unpin for FontFamily
impl UnsafeUnpin for FontFamilywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
impl UnwindSafe for FontFamily
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.