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 PartialOrd for PxScale
impl PartialOrd for PxScale
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more