#[repr(u8)]pub enum GenericFamily {
Show 13 variants
Serif = 0,
SansSerif = 1,
Monospace = 2,
Cursive = 3,
Fantasy = 4,
SystemUi = 5,
UiSerif = 6,
UiSansSerif = 7,
UiMonospace = 8,
UiRounded = 9,
Emoji = 10,
Math = 11,
FangSong = 12,
}Expand description
Describes a generic font family.
Variants§
Serif = 0
Glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings.
SansSerif = 1
Glyphs have stroke endings that are plain.
Monospace = 2
All glyphs have the same fixed width.
Cursive = 3
Glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. The glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letter work.
Fantasy = 4
Fantasy fonts are primarily decorative fonts that contain playful representations of characters
SystemUi = 5
Glyphs are taken from the default user interface font on a given platform.
UiSerif = 6
The default user interface serif font.
UiSansSerif = 7
The default user interface sans-serif font.
UiMonospace = 8
The default user interface monospace font.
UiRounded = 9
The default user interface font that has rounded features.
Emoji = 10
Fonts that are specifically designed to render emoji.
Math = 11
This is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings.
FangSong = 12
A particular style of Chinese characters that are between serif-style Song and cursive-style Kai forms. This style is often used for government documents.
Implementations§
Source§impl GenericFamily
impl GenericFamily
Sourcepub fn parse(s: &str) -> Option<GenericFamily>
pub fn parse(s: &str) -> Option<GenericFamily>
Parses a generic family from a CSS generic family name.
§Example
assert_eq!(GenericFamily::parse("sans-serif"), Some(GenericFamily::SansSerif));
assert_eq!(GenericFamily::parse("Arial"), None);Sourcepub const fn all() -> &'static [GenericFamily]
pub const fn all() -> &'static [GenericFamily]
Returns a slice containing all generic family variants.
Trait Implementations§
Source§impl CheckedBitPattern for GenericFamily
impl CheckedBitPattern for GenericFamily
Source§type Bits = u8
type Bits = u8
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(bits: &u8) -> bool
fn is_valid_bit_pattern(bits: &u8) -> bool
bits
as &Self.Source§impl Clone for GenericFamily
impl Clone for GenericFamily
Source§fn clone(&self) -> GenericFamily
fn clone(&self) -> GenericFamily
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Contiguous for GenericFamily
impl Contiguous for GenericFamily
Source§type Int = u8
type Int = u8
Source§fn from_integer(value: Self::Int) -> Option<Self>
fn from_integer(value: Self::Int) -> Option<Self>
value is within the range for valid instances of this type,
returns Some(converted_value), otherwise, returns None. Read moreSource§fn into_integer(self) -> Self::Int
fn into_integer(self) -> Self::Int
C into the underlying integral type. This
mostly exists otherwise generic code would need unsafe for the value as integer Read moreSource§impl Debug for GenericFamily
impl Debug for GenericFamily
Source§impl Display for GenericFamily
impl Display for GenericFamily
Source§impl From<GenericFamily> for FamilyName
impl From<GenericFamily> for FamilyName
Source§fn from(gf: GenericFamily) -> Self
fn from(gf: GenericFamily) -> Self
Source§impl Hash for GenericFamily
impl Hash for GenericFamily
Source§impl PartialEq for GenericFamily
impl PartialEq for GenericFamily
impl Copy for GenericFamily
impl Eq for GenericFamily
impl NoUninit for GenericFamily
impl StructuralPartialEq for GenericFamily
Auto Trait Implementations§
impl Freeze for GenericFamily
impl RefUnwindSafe for GenericFamily
impl Send for GenericFamily
impl Sync for GenericFamily
impl Unpin for GenericFamily
impl UnwindSafe for GenericFamily
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> 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
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.