Skip to main content

ScaleF32

Struct ScaleF32 

Source
pub struct ScaleF32 {
    scale: f32,
}
Expand description

Scales font units to floating point pixels, reproducing HarfBuzz’s arithmetic.

Fields§

§scale: f32

Implementations§

Source§

impl ScaleF32

Source

pub fn new(ppem: Option<f32>, units_per_em: u16) -> Self

Creates a scale for the given size in pixels per em.

Trait Implementations§

Source§

impl Clone for ScaleF32

Source§

fn clone(&self) -> ScaleF32

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ScaleF32

Source§

impl Debug for ScaleF32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Scale for ScaleF32

Source§

const NEEDS_UNSCALED: bool = false

True if the scale keeps a parallel copy of the points in font units, which hinting needs and which sparse delta interpolation uses as its reference coordinates.
Source§

type Coord = f32

Coordinate type of the loaded outline.
Source§

type Delta = f32

Accumulator type for variation deltas.
Source§

fn is_scaled(&self) -> bool

True if a size was supplied. When false the outline comes back in font units, expressed in Self::Coord.
Source§

fn phantom_from_font_units(&self, value: i32) -> f32

Converts a font unit value into the representation phantom points use before they are scaled.
Source§

fn coord_to_hinting_raw(&self, value: f32) -> i32

Reinterprets an output coordinate as the integer a hinter’s font unit buffer holds. Read more
Source§

fn scale_phantom(&self, point: Point<f32>) -> Point<f32>

Scales a phantom point that still holds font units.
Source§

fn add_phantom_delta(&self, point: Point<f32>, delta: Point<f32>) -> Point<f32>

Adds a composite glyph’s phantom point delta.
Source§

fn round_phantom(&self, point: Point<f32>) -> Point<f32>

Rounds a phantom point, which FreeType does before hinting.
Source§

fn load_empty_phantom( &self, phantom: &mut [Point<f32>; 4], deltas: Option<[Point<Fixed>; 4]>, )

Sets the phantom points of a glyph with no outline. Read more
Source§

fn load_simple_points( &self, pass: SimplePass<'_, '_, Self>, ) -> Result<[Point<f32>; 4], Error>

Reads a simple glyph’s points, applies variation deltas, appends the phantom points and writes the scaled result. Read more
Source§

fn transform_points(&self, points: &mut [Point<f32>], transform: &Transform)

Applies a component’s 2x2 transform to points that have already been placed. Read more
Source§

fn component_offset( &self, offset: Point<i32>, transform: &Transform, scale_offset: bool, delta: Option<Point<f32>>, _rounding: OffsetRounding, ) -> Point<f32>

Computes the translation for a component given as an offset. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.