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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)