#[repr(u32)]pub enum GenericFontFamily {
Serif = 1,
SansSerif = 2,
Monospace = 3,
Cursive = 4,
Fantasy = 5,
SystemUi = 6,
Emoji = 7,
Math = 8,
Fangsong = 9,
}
Expand description
Generic groups of font families that can serve as fallbacks for a specific family.
Every font family belongs to some generic font family (see examples below).
If an exact requested family is unavailable but a fallback group is specified in the request,
the provider may return some other family that belongs to the fallback group. For example, if
the client requests the “Arial” family with a SANS_SERIF
fallback, and “Arial” is unavailable,
the provider may return another available sans serif family, such as “Roboto Regular”, instead.
See also: https://www.w3.org/TR/css-fonts-4/#generic-font-families
Variants§
Serif = 1
Glyphs have little “serifs”, hooks, or notches at the ends of most strokes. Examples: Georgia, Noto Serif, Times New Roman.
SansSerif = 2
Glyphs that have no serifs at the ends of most strokes. Examples: Arial, Noto Sans, Roboto, Tahoma.
Monospace = 3
Fixed-width fonts. Examples: Consolas, Courier New, Inconsolata.
Cursive = 4
Handwritten or cursive fonts. Examples: Brush Script, Comic Sans, Lucida Calligraphy.
Fantasy = 5
Decorative fonts. Examples: Impact, Papyrus.
SystemUi = 6
The default user interface font on the target platform.
This is included for completeness with the CSS specification; font manifests should not
declare that a font belongs to the SYSTEM_UI
generic family, but instead should declare a
more specific option (e.g. SERIF
for Roboto).
Not commonly used.
Emoji = 7
Fonts that are used specifically for rendering emoji code points. Examples: Noto Color Emoji.
Math = 8
Fonts that are used primarily for rendering mathematical expressions.
Not commonly used.
Fangsong = 9
A group of Chinese fonts between serif and cursive, often used for official Chinese Government documents.
Not commonly used.
Implementations§
source§impl GenericFontFamily
impl GenericFontFamily
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
source§impl Clone for GenericFontFamily
impl Clone for GenericFontFamily
source§fn clone(&self) -> GenericFontFamily
fn clone(&self) -> GenericFontFamily
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GenericFontFamily
impl Debug for GenericFontFamily
source§impl Decode<GenericFontFamily> for GenericFontFamily
impl Decode<GenericFontFamily> for GenericFontFamily
source§impl Encode<GenericFontFamily> for GenericFontFamily
impl Encode<GenericFontFamily> for GenericFontFamily
source§impl Hash for GenericFontFamily
impl Hash for GenericFontFamily
source§impl Ord for GenericFontFamily
impl Ord for GenericFontFamily
source§fn cmp(&self, other: &GenericFontFamily) -> Ordering
fn cmp(&self, other: &GenericFontFamily) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for GenericFontFamily
impl PartialEq for GenericFontFamily
source§fn eq(&self, other: &GenericFontFamily) -> bool
fn eq(&self, other: &GenericFontFamily) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for GenericFontFamily
impl PartialOrd for GenericFontFamily
source§fn partial_cmp(&self, other: &GenericFontFamily) -> Option<Ordering>
fn partial_cmp(&self, other: &GenericFontFamily) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TypeMarker for GenericFontFamily
impl TypeMarker for GenericFontFamily
§type Owned = GenericFontFamily
type Owned = GenericFontFamily
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for GenericFontFamily
impl ValueTypeMarker for GenericFontFamily
§type Borrowed<'a> = GenericFontFamily
type Borrowed<'a> = GenericFontFamily
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more