#[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<D: ResourceDialect> Decode<GenericFontFamily, D> for GenericFontFamily
impl<D: ResourceDialect> Decode<GenericFontFamily, D> for GenericFontFamily
Source§impl<D: ResourceDialect> Encode<GenericFontFamily, D> for GenericFontFamily
impl<D: ResourceDialect> Encode<GenericFontFamily, D> 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§impl PartialOrd for GenericFontFamily
impl PartialOrd for GenericFontFamily
Source§impl TypeMarker for GenericFontFamily
impl TypeMarker for GenericFontFamily
Source§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
Source§type Borrowed<'a> = GenericFontFamily
type Borrowed<'a> = GenericFontFamily
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for GenericFontFamily
impl Eq for GenericFontFamily
impl StructuralPartialEq for GenericFontFamily
Auto Trait Implementations§
impl Freeze for GenericFontFamily
impl RefUnwindSafe for GenericFontFamily
impl Send for GenericFontFamily
impl Sync for GenericFontFamily
impl Unpin for GenericFontFamily
impl UnwindSafe for GenericFontFamily
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)