pub struct PxScale {
pub x: f32,
pub y: f32,
}
Expand description
Pixel scale.
This is the pixel-height of text.
Usually one uses x == y
, but one may use a different ratio to stretch a
font horizontally or vertically.
To convert pt size into pixel-scale see Font::pt_to_px_scale
.
§Example
use ab_glyph::PxScale;
let uniform_scale_24px = PxScale::from(24.0);
Fields§
§x: f32
Horizontal scale in pixels.
y: f32
Vertical scale in pixels.
By definition, this is the pixel-height of a font.
Implementations§
Trait Implementations§
source§impl PartialEq for PxScale
impl PartialEq for PxScale
source§impl PartialOrd for PxScale
impl PartialOrd for PxScale
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 PxScale
impl StructuralPartialEq for PxScale
Auto Trait Implementations§
impl Freeze for PxScale
impl RefUnwindSafe for PxScale
impl Send for PxScale
impl Sync for PxScale
impl Unpin for PxScale
impl UnwindSafe for PxScale
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