pub struct FontFace { /* private fields */ }Expand description
A font the page loads, written as @font-face.
Implementations§
Source§impl FontFace
impl FontFace
Sourcepub fn new(family: &'static str, src: Url) -> Self
pub fn new(family: &'static str, src: Url) -> Self
The font family loaded from src, a WOFF2 file or any format the
browser recognizes from the file.
Sourcepub fn weights(self, min: u16, max: u16) -> Self
pub fn weights(self, min: u16, max: u16) -> Self
The weights the file covers, from min to max, as a variable font
declares them. One weight is weights(400, 400).
Sourcepub fn family(&self) -> FontFamily
pub fn family(&self) -> FontFamily
The family as font-family takes it.
Trait Implementations§
impl Eq for FontFace
impl StructuralPartialEq for FontFace
Auto Trait Implementations§
impl Freeze for FontFace
impl RefUnwindSafe for FontFace
impl Send for FontFace
impl Sync for FontFace
impl Unpin for FontFace
impl UnsafeUnpin for FontFace
impl UnwindSafe for FontFace
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