#[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("SERIF"), Some(GenericFamily::Serif));
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 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 more