Struct wr_glyph_rasterizer::rasterizer::FontTransform
source · pub struct FontTransform {
pub scale_x: f32,
pub skew_x: f32,
pub skew_y: f32,
pub scale_y: f32,
}
Fields§
§scale_x: f32
§skew_x: f32
§skew_y: f32
§scale_y: f32
Implementations§
source§impl FontTransform
impl FontTransform
const QUANTIZE_SCALE: f32 = 1024f32
pub fn new(scale_x: f32, skew_x: f32, skew_y: f32, scale_y: f32) -> Self
pub fn identity() -> Self
pub fn is_identity(&self) -> bool
pub fn quantize(&self) -> Self
pub fn determinant(&self) -> f64
pub fn compute_scale(&self) -> Option<(f64, f64)>
pub fn pre_scale(&self, scale_x: f32, scale_y: f32) -> Self
pub fn scale(&self, scale: f32) -> Self
pub fn invert_scale(&self, x_scale: f64, y_scale: f64) -> Self
pub fn synthesize_italics( &self, angle: SyntheticItalics, size: f64, vertical: bool, ) -> (Self, (f64, f64))
pub fn swap_xy(&self) -> Self
pub fn flip_x(&self) -> Self
pub fn flip_y(&self) -> Self
pub fn transform(&self, point: &LayoutPoint) -> DevicePoint
pub fn get_subpx_dir(&self) -> SubpixelDirection
Trait Implementations§
source§impl Clone for FontTransform
impl Clone for FontTransform
source§fn clone(&self) -> FontTransform
fn clone(&self) -> FontTransform
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FontTransform
impl Debug for FontTransform
source§impl<'a> From<&'a Transform3D<f32, LayoutPixel, WorldPixel>> for FontTransform
impl<'a> From<&'a Transform3D<f32, LayoutPixel, WorldPixel>> for FontTransform
source§fn from(xform: &'a LayoutToWorldTransform) -> Self
fn from(xform: &'a LayoutToWorldTransform) -> Self
Converts to this type from the input type.
source§impl Hash for FontTransform
impl Hash for FontTransform
source§impl MallocSizeOf for FontTransform
impl MallocSizeOf for FontTransform
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl Ord for FontTransform
impl Ord for FontTransform
source§impl PartialEq for FontTransform
impl PartialEq for FontTransform
source§impl PartialOrd for FontTransform
impl PartialOrd for FontTransform
source§impl Serialize for FontTransform
impl Serialize for FontTransform
impl Copy for FontTransform
impl Eq for FontTransform
impl StructuralPartialEq for FontTransform
Auto Trait Implementations§
impl Freeze for FontTransform
impl RefUnwindSafe for FontTransform
impl Send for FontTransform
impl Sync for FontTransform
impl Unpin for FontTransform
impl UnwindSafe for FontTransform
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
)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