pub enum FontSource {
Url {
url: FontSourceUrl,
format: Option<FontFormat>,
tech: Option<FontTech>,
},
Local {
name: String,
},
}Expand description
A single entry of a CSS @font-face src descriptor.
A Url points at a font file to download, with optional
format() and tech() hints the browser uses to skip files it cannot use.
A Local names a font already installed on the system.
Renders as the corresponding CSS, e.g. url("/font.woff2") format(woff2) or
local("Helvetica Neue").
Variants§
Url
A downloadable font file, with optional format and technology hints.
Fields
§
url: FontSourceUrlWhere the font file is located.
§
format: Option<FontFormat>The font file format, written as a format() hint.
Local
A locally installed font, named by a local() entry.
Implementations§
Source§impl FontSource
impl FontSource
Sourcepub fn url(
url: impl Into<FontSourceUrl>,
format: Option<FontFormat>,
tech: Option<FontTech>,
) -> Self
pub fn url( url: impl Into<FontSourceUrl>, format: Option<FontFormat>, tech: Option<FontTech>, ) -> Self
A downloadable source from a URL, with optional format() and tech()
hints.
Sourcepub fn local(name: impl Into<String>) -> Self
pub fn local(name: impl Into<String>) -> Self
A source naming a font already installed on the system.
Trait Implementations§
Source§impl Clone for FontSource
impl Clone for FontSource
Source§fn clone(&self) -> FontSource
fn clone(&self) -> FontSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FontSource
impl Debug for FontSource
impl Eq for FontSource
Source§impl Hash for FontSource
impl Hash for FontSource
Source§impl PartialEq for FontSource
impl PartialEq for FontSource
impl StructuralPartialEq for FontSource
Auto Trait Implementations§
impl Freeze for FontSource
impl RefUnwindSafe for FontSource
impl Send for FontSource
impl Sync for FontSource
impl Unpin for FontSource
impl UnsafeUnpin for FontSource
impl UnwindSafe for FontSource
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
Mutably borrows from an owned value. Read more