Skip to main content

Unscaled

Struct Unscaled 

Source
pub struct Unscaled;
Expand description

Leaves coordinates in font units.

Variations still apply, and composite components are still transformed and placed, but nothing is scaled or rounded to a pixel grid. This is what an autohinter wants: the outline as the designer drew it, at the requested location in variation space.

The arithmetic matches Scale26Dot6 at no size, without the round trip through 26.6 that getting font units back out would otherwise need.

Trait Implementations§

Source§

impl Clone for Unscaled

Source§

fn clone(&self) -> Unscaled

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 Unscaled

Source§

impl Debug for Unscaled

Source§

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

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

impl Default for Unscaled

Source§

fn default() -> Unscaled

Returns the “default value” for a type. Read more
Source§

impl Scale for Unscaled

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 = i32

Coordinate type of the loaded outline.
Source§

type Delta = Fixed

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) -> i32

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

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

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

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

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

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

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

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

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

fn load_empty_phantom( &self, phantom: &mut [Point<i32>; 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<i32>; 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<i32>], 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<Fixed>>, _rounding: OffsetRounding, ) -> Point<i32>

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.