pub enum FontFamily {
Default,
SansSerif,
Serif,
Monospace,
Cursive,
Fantasy,
Named(String),
FileBacked(FileBackedFontFamily),
LoadedTypeface(LoadedTypefacePath),
}Expand description
The font family of a text. Compose’s FontFamily.
Variants§
Default
The default font of the platform.
SansSerif
A generic sans-serif font.
Serif
A generic serif font.
Monospace
A generic monospace font.
Cursive
A generic cursive font.
Fantasy
A generic fantasy font.
Named(String)
A family looked up by name among the fonts the renderer has.
FileBacked(FileBackedFontFamily)
A family built from font files.
LoadedTypeface(LoadedTypefacePath)
A family identified by the path of a typeface file.
Implementations§
Source§impl FontFamily
impl FontFamily
Sourcepub fn named(name: impl Into<String>) -> FontFamily
pub fn named(name: impl Into<String>) -> FontFamily
Returns the family for name, as FontFamily::from_name does.
Sourcepub fn from_name(name: &str) -> FontFamily
pub fn from_name(name: &str) -> FontFamily
Returns the generic family for name when it is a generic name such as serif or
sans-serif, or an empty or default name, and Named for any other name.
Sourcepub fn file_backed(fonts: Vec<FontFile>) -> Result<FontFamily, FontFamilyError>
pub fn file_backed(fonts: Vec<FontFile>) -> Result<FontFamily, FontFamilyError>
Builds a FileBacked family from fonts, or fails when the list is empty.
Sourcepub fn loaded_typeface_path(path: impl Into<String>) -> FontFamily
pub fn loaded_typeface_path(path: impl Into<String>) -> FontFamily
Builds a LoadedTypeface family for the typeface file at path.
Sourcepub fn family_name(&self) -> Option<&str>
pub fn family_name(&self) -> Option<&str>
Returns the name of a Named family, and None for every other variant.
Trait Implementations§
Source§impl Clone for FontFamily
impl Clone for FontFamily
Source§fn clone(&self) -> FontFamily
fn clone(&self) -> FontFamily
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FontFamily
impl Debug for FontFamily
Source§impl Default for FontFamily
impl Default for FontFamily
Source§fn default() -> FontFamily
fn default() -> FontFamily
impl Eq for FontFamily
Source§impl From<&str> for FontFamily
impl From<&str> for FontFamily
Source§fn from(value: &str) -> FontFamily
fn from(value: &str) -> FontFamily
Source§impl From<String> for FontFamily
impl From<String> for FontFamily
Source§fn from(value: String) -> FontFamily
fn from(value: String) -> FontFamily
Source§impl Hash for FontFamily
impl Hash for FontFamily
Source§impl PartialEq for FontFamily
impl PartialEq for FontFamily
impl StructuralPartialEq for FontFamily
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 FontFamily
impl UnwindSafe for FontFamily
Blanket Implementations§
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
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more