pub struct Font { /* private fields */ }Expand description
A reference to a font.
Implementations§
Source§impl Font
impl Font
Sourcepub fn new(font_family: &str) -> Result<Self, CanvasError>
pub fn new(font_family: &str) -> Result<Self, CanvasError>
Creates a new font with the given family.
Sourcepub fn system(weight: FontWeight) -> Self
pub fn system(weight: FontWeight) -> Self
Creates a new font with the system default family and the given weight.
Sourcepub fn load(url: &str) -> Result<Self, CanvasError>
pub fn load(url: &str) -> Result<Self, CanvasError>
Loads a font from the given URL.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnwindSafe for Font
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