[−]Struct druid::FontFamily
A reference to a font family.
This may be either a CSS-style "generic family name", such as "serif" or "monospace", or it can be an explicit family name.
To use a generic family name, use the provided associated constants:
FontFamily::SERIF
, FontFamily::SANS_SERIF
, FontFamily::SYSTEM_UI
,
and FontFamily::MONOSPACE
.
To use a specific font family you should not construct this type directly;
instead you should verify that the desired family exists, via the
Text::font
API.
Implementations
impl FontFamily
pub const SANS_SERIF: FontFamily
A san-serif font, such as Arial or Helvetica.
pub const SERIF: FontFamily
A serif font, such as Times New Roman or Charter.
pub const SYSTEM_UI: FontFamily
The platform's preferred UI font; San Francisco on macOS, and Segoe UI on recent Windows.
pub const MONOSPACE: FontFamily
A monospace font.
pub fn new_unchecked(s: impl Into<Arc<str>>) -> FontFamily
Create a new font family with a given name, without verifying that it exists.
This should generally not be used; instead you should create a FontFamily
by calling the Text::font_family
method, which verifies that the
family name exists.
pub fn name(&self) -> &str
pub fn is_generic(&self) -> bool
Returns true
if this is a generic font family.
Trait Implementations
impl Clone for FontFamily
pub fn clone(&self) -> FontFamily
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Data for FontFamily
[src]
impl Debug for FontFamily
impl Default for FontFamily
pub fn default() -> FontFamily
impl Eq for FontFamily
impl From<FontFamily> for TextAttribute
pub fn from(t: FontFamily) -> TextAttribute
impl Hash for FontFamily
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<FontFamily> for FontFamily
pub fn eq(&self, other: &FontFamily) -> bool
pub fn ne(&self, other: &FontFamily) -> bool
impl StructuralEq for FontFamily
impl StructuralPartialEq for FontFamily
Auto Trait Implementations
impl RefUnwindSafe for FontFamily
[src]
impl Send for FontFamily
[src]
impl Sync for FontFamily
[src]
impl Unpin for FontFamily
[src]
impl UnwindSafe for FontFamily
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AnyEq for T where
T: PartialEq<T> + Any,
[src]
T: PartialEq<T> + Any,
pub fn equals(&self, other: &(dyn Any + 'static)) -> bool
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
pub fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
pub fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,