pub struct Size(/* private fields */);Expand description
Font size in pixels per em units.
Sizes in this crate are represented as a ratio of pixels to the size of
the em square defined by the font. This is equivalent to the px unit
in CSS (assuming a DPI scale factor of 1.0).
To retrieve metrics and outlines in font units, use the unscaled construtor on this type.
Implementations§
source§impl Size
impl Size
sourcepub fn new(ppem: f32) -> Self
pub fn new(ppem: f32) -> Self
Creates a new font size from the given value in pixels per em units.
sourcepub fn unscaled() -> Self
pub fn unscaled() -> Self
Creates a new font size for generating unscaled metrics or outlines in font units.
Trait Implementations§
source§impl From<Size> for DrawSettings<'_>
impl From<Size> for DrawSettings<'_>
source§impl PartialEq for Size
impl PartialEq for Size
source§impl PartialOrd for Size
impl PartialOrd for Size
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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