pub enum FontFormat {
Collection,
EmbeddedOpenType,
OpenType,
Svg,
TrueType,
Woff,
Woff2,
}Expand description
A font file format, as named by the format() hint of a CSS @font-face
src descriptor.
Displays as the CSS format keyword used inside format(...) (woff2,
opentype, embedded-opentype, …).
Variants§
Collection
OpenType Collection (.otc, .ttc), CSS collection.
EmbeddedOpenType
Embedded OpenType (.eot), CSS embedded-opentype.
OpenType
OpenType (.otf, .ttf), CSS opentype.
Svg
SVG Font (.svg, .svgz), CSS svg.
SVG fonts are deprecated and unsupported by most modern browsers.
TrueType
TrueType (.ttf), CSS truetype.
Woff
WOFF 1.0 (.woff), CSS woff.
Woff2
WOFF 2.0 (.woff2), CSS woff2.
Implementations§
Source§impl FontFormat
impl FontFormat
Sourcepub const fn keyword(self) -> &'static str
pub const fn keyword(self) -> &'static str
The CSS format keyword for this format, as written inside format(...).
Sourcepub fn from_keyword(keyword: &str) -> Option<Self>
pub fn from_keyword(keyword: &str) -> Option<Self>
The format named by the given CSS format(...) keyword, if the keyword
names a known format.
Sourcepub const fn mime_type(self) -> &'static str
pub const fn mime_type(self) -> &'static str
The MIME type of this format, as used in a type attribute (e.g. on a
<link rel="preload" as="font">).
Sourcepub const fn extensions(self) -> &'static [&'static str]
pub const fn extensions(self) -> &'static [&'static str]
Trait Implementations§
Source§impl Clone for FontFormat
impl Clone for FontFormat
Source§fn clone(&self) -> FontFormat
fn clone(&self) -> FontFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more