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
impl PartialOrd<PxScale> for PxScale
impl PartialOrd<PxScale> for PxScale
fn partial_cmp(&self, other: &PxScale) -> Option<Ordering>
fn partial_cmp(&self, other: &PxScale) -> Option<Ordering>
1.0.0 · sourcefn 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 RefUnwindSafe for PxScale
impl Send for PxScale
impl Sync for PxScale
impl Unpin for PxScale
impl UnwindSafe for PxScale
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> HasMut<T> for T
impl<T> HasMut<T> for T
sourcefn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.