[][src]Struct piet::FontFamily

pub struct 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[src]

pub const SANS_SERIF: FontFamily[src]

A san-serif font, such as Arial or Helvetica.

pub const SERIF: FontFamily[src]

A serif font, such as Times New Roman or Charter.

pub const SYSTEM_UI: FontFamily[src]

The platform's preferred UI font; San Francisco on macOS, and Segoe UI on recent Windows.

pub const MONOSPACE: FontFamily[src]

A monospace font.

pub fn new_unchecked(s: impl Into<Arc<str>>) -> Self[src]

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[src]

pub fn is_generic(&self) -> bool[src]

Returns true if this is a generic font family.

Trait Implementations

impl Clone for FontFamily[src]

impl Debug for FontFamily[src]

impl Default for FontFamily[src]

impl Eq for FontFamily[src]

impl From<FontFamily> for TextAttribute[src]

impl PartialEq<FontFamily> for FontFamily[src]

impl StructuralEq for FontFamily[src]

impl StructuralPartialEq for FontFamily[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.