pub struct CanvasFont {
pub family: Option<String>,
pub weight: Option<FontWeight>,
pub italic: bool,
}Expand description
What canvas text is drawn with beyond its size (docs/canvas.md “Text”): a family, a weight and a slant. The default is the platform’s own UI face, regular, upright, which is what every backend drew before the field existed, so a default font encodes to nothing on the wire.
Fields§
§family: Option<String>A platform or bundled family name (as Toolkit::font_families lists it); None =
the platform’s default UI face.
weight: Option<FontWeight>None = Regular.
italic: boolImplementations§
Source§impl CanvasFont
impl CanvasFont
Sourcepub fn family_str(&self) -> &str
pub fn family_str(&self) -> &str
The family name to send over the wire, empty for the default.
Sourcepub fn css_weight(&self) -> u16
pub fn css_weight(&self) -> u16
The CSS weight to send over the wire, 0 for the default.
Trait Implementations§
Source§impl Clone for CanvasFont
impl Clone for CanvasFont
Source§fn clone(&self) -> CanvasFont
fn clone(&self) -> CanvasFont
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 CanvasFont
impl Debug for CanvasFont
Source§impl Default for CanvasFont
impl Default for CanvasFont
Source§fn default() -> CanvasFont
fn default() -> CanvasFont
Returns the “default value” for a type. Read more
impl Eq for CanvasFont
Source§impl PartialEq for CanvasFont
impl PartialEq for CanvasFont
impl StructuralPartialEq for CanvasFont
Auto Trait Implementations§
impl Freeze for CanvasFont
impl RefUnwindSafe for CanvasFont
impl Send for CanvasFont
impl Sync for CanvasFont
impl Unpin for CanvasFont
impl UnsafeUnpin for CanvasFont
impl UnwindSafe for CanvasFont
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