Struct piet_common::FontFamily
source · 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
sourceimpl FontFamily
impl FontFamily
sourcepub const SANS_SERIF: FontFamily = FontFamily(FontFamilyInner::SansSerif)
pub const SANS_SERIF: FontFamily = FontFamily(FontFamilyInner::SansSerif)
A san-serif font, such as Arial or Helvetica.
sourcepub const SERIF: FontFamily = FontFamily(FontFamilyInner::Serif)
pub const SERIF: FontFamily = FontFamily(FontFamilyInner::Serif)
A serif font, such as Times New Roman or Charter.
sourcepub const SYSTEM_UI: FontFamily = FontFamily(FontFamilyInner::SystemUi)
pub const SYSTEM_UI: FontFamily = FontFamily(FontFamilyInner::SystemUi)
The platform’s preferred UI font; San Francisco on macOS, and Segoe UI on recent Windows.
sourcepub const MONOSPACE: FontFamily = FontFamily(FontFamilyInner::Monospace)
pub const MONOSPACE: FontFamily = FontFamily(FontFamilyInner::Monospace)
A monospace font.
sourcepub fn new_unchecked(s: impl Into<Arc<str>>) -> FontFamily
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.
sourcepub fn is_generic(&self) -> bool
pub fn is_generic(&self) -> bool
Returns true if this is a generic font family.
Trait Implementations
sourceimpl Clone for FontFamily
impl Clone for FontFamily
sourcefn clone(&self) -> FontFamily
fn clone(&self) -> FontFamily
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more