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
Glyph zone for TrueType hinting.
See https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructing_glyphs#zones
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>
impl<'a> Zone<'a>
Sourcepub fn new(
unscaled: &'a [Point<i32>],
original: &'a mut [Point<F26Dot6>],
points: &'a mut [Point<F26Dot6>],
flags: &'a mut [PointFlags],
contours: &'a [u16],
) -> Self
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.
pub fn point(&self, index: usize) -> Result<Point<F26Dot6>, HintErrorKind>
pub fn point_mut( &mut self, index: usize, ) -> Result<&mut Point<F26Dot6>, HintErrorKind>
pub fn original(&self, index: usize) -> Result<Point<F26Dot6>, HintErrorKind>
pub fn original_mut( &mut self, index: usize, ) -> Result<&mut Point<F26Dot6>, HintErrorKind>
pub fn unscaled(&self, index: usize) -> Point<i32>
pub fn contour(&self, index: usize) -> Result<u16, HintErrorKind>
pub fn touch( &mut self, index: usize, axis: CoordAxis, ) -> Result<(), HintErrorKind>
pub fn untouch( &mut self, index: usize, axis: CoordAxis, ) -> Result<(), HintErrorKind>
pub fn is_touched( &self, index: usize, axis: CoordAxis, ) -> Result<bool, HintErrorKind>
pub fn flip_on_curve(&mut self, index: usize) -> Result<(), HintErrorKind>
pub fn set_on_curve( &mut self, start: usize, end: usize, on: bool, ) -> Result<(), HintErrorKind>
Sourcepub fn iup(&mut self, axis: CoordAxis) -> Result<(), HintErrorKind>
pub fn iup(&mut self, axis: CoordAxis) -> Result<(), HintErrorKind>
Interpolate untouched points.
Sourcefn iup_shift(
&mut self,
axis: CoordAxis,
p1: usize,
p2: usize,
p: usize,
) -> Result<(), HintErrorKind>
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.
Sourcefn iup_interpolate(
&mut self,
axis: CoordAxis,
p1: usize,
p2: usize,
ref1: usize,
ref2: usize,
) -> Result<(), HintErrorKind>
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.
Trait Implementations§
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> 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