#[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
Generic font families, named after CSS.
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
Decorative fonts with 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 const MAX_VALUE: u8
pub const MAX_VALUE: u8
Returns the maximum numeric value for known variants.
This is primarily intended for use in fixed-size maps keyed by 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.
use parlance::GenericFamily;
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 (const: unstable) · 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§const MAX_VALUE: u8 = GenericFamily::MAX_VALUE
const MAX_VALUE: u8 = GenericFamily::MAX_VALUE
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 QueryFamily<'static>
impl From<GenericFamily> for QueryFamily<'static>
Source§fn from(value: GenericFamily) -> Self
fn from(value: GenericFamily) -> Self
Source§impl Hash for GenericFamily
impl Hash for GenericFamily
Source§impl PartialEq for GenericFamily
impl PartialEq for GenericFamily
Source§fn eq(&self, other: &GenericFamily) -> bool
fn eq(&self, other: &GenericFamily) -> bool
self and other values to be equal, and is used by ==.