Struct Zone

Source
pub struct Zone<'a> {
    pub unscaled: &'a [Point<i32>],
    pub original: &'a mut [Point<F26Dot6>],
    pub points: &'a mut [Point<F26Dot6>],
    pub flags: &'a mut [PointFlags],
    pub contours: &'a [u16],
}
Expand description

Fields§

§unscaled: &'a [Point<i32>]

Outline points prior to applying scale.

§original: &'a mut [Point<F26Dot6>]

Copy of the outline points after applying scale.

§points: &'a mut [Point<F26Dot6>]

Scaled outline points.

§flags: &'a mut [PointFlags]§contours: &'a [u16]

Implementations§

Source§

impl<'a> Zone<'a>

Source

pub fn new( unscaled: &'a [Point<i32>], original: &'a mut [Point<F26Dot6>], points: &'a mut [Point<F26Dot6>], flags: &'a mut [PointFlags], contours: &'a [u16], ) -> Self

Creates a new hinting zone.

Source

pub fn point(&self, index: usize) -> Result<Point<F26Dot6>, HintErrorKind>

Source

pub fn point_mut( &mut self, index: usize, ) -> Result<&mut Point<F26Dot6>, HintErrorKind>

Source

pub fn original(&self, index: usize) -> Result<Point<F26Dot6>, HintErrorKind>

Source

pub fn original_mut( &mut self, index: usize, ) -> Result<&mut Point<F26Dot6>, HintErrorKind>

Source

pub fn unscaled(&self, index: usize) -> Point<i32>

Source

pub fn contour(&self, index: usize) -> Result<u16, HintErrorKind>

Source

pub fn touch( &mut self, index: usize, axis: CoordAxis, ) -> Result<(), HintErrorKind>

Source

pub fn untouch( &mut self, index: usize, axis: CoordAxis, ) -> Result<(), HintErrorKind>

Source

pub fn is_touched( &self, index: usize, axis: CoordAxis, ) -> Result<bool, HintErrorKind>

Source

pub fn flip_on_curve(&mut self, index: usize) -> Result<(), HintErrorKind>

Source

pub fn set_on_curve( &mut self, start: usize, end: usize, on: bool, ) -> Result<(), HintErrorKind>

Source

pub fn iup(&mut self, axis: CoordAxis) -> Result<(), HintErrorKind>

Source

fn iup_shift( &mut self, axis: CoordAxis, p1: usize, p2: usize, p: usize, ) -> Result<(), HintErrorKind>

Shift the range of points p1..=p2 based on the delta given by the reference point p.

Based on https://gitlab.freedesktop.org/freetype/freetype/-/blob/57617782464411201ce7bbc93b086c1b4d7d84a5/src/truetype/ttinterp.c#L6262

Source

fn iup_interpolate( &mut self, axis: CoordAxis, p1: usize, p2: usize, ref1: usize, ref2: usize, ) -> Result<(), HintErrorKind>

Interpolate the range of points p1..=p2 based on the deltas given by the two reference points.

Based on https://gitlab.freedesktop.org/freetype/freetype/-/blob/57617782464411201ce7bbc93b086c1b4d7d84a5/src/truetype/ttinterp.c#L6284

Trait Implementations§

Source§

impl<'a> Debug for Zone<'a>

Source§

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

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

impl<'a> Default for Zone<'a>

Source§

fn default() -> Zone<'a>

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

Auto Trait Implementations§

§

impl<'a> Freeze for Zone<'a>

§

impl<'a> RefUnwindSafe for Zone<'a>

§

impl<'a> Send for Zone<'a>

§

impl<'a> Sync for Zone<'a>

§

impl<'a> Unpin for Zone<'a>

§

impl<'a> !UnwindSafe for Zone<'a>

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> 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, 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.