Struct piet::FontFamily [−][src]
pub struct FontFamily(_);
Expand description
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
A san-serif font, such as Arial or Helvetica.
A serif font, such as Times New Roman or Charter.
The platform’s preferred UI font; San Francisco on macOS, and Segoe UI on recent Windows.
A monospace font.
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.
Returns true
if this is a generic font family.
Trait Implementations
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for FontFamily
impl Send for FontFamily
impl Sync for FontFamily
impl Unpin for FontFamily
impl UnwindSafe for FontFamily
Blanket Implementations
Mutably borrows from an owned value. Read more