Skip to main content

OutlineRef

Struct OutlineRef 

Source
pub struct OutlineRef<'a, C: PointCoord> {
    pub(super) points: &'a [Point<C>],
    pub(super) flags: &'a [PointFlags],
    pub(super) contours: &'a [u16],
    pub(super) phantom: [Point<C>; 4],
}
Expand description

A loaded outline that borrows the caller’s buffers.

Has the same accessors as Outline.

Fields§

§points: &'a [Point<C>]§flags: &'a [PointFlags]§contours: &'a [u16]§phantom: [Point<C>; 4]

Implementations§

Source§

impl<C: PointCoord> OutlineRef<'_, C>

Source

pub fn points(&self) -> &[Point<C>]

The loaded points, excluding phantom points.

Source

pub fn flags(&self) -> &[PointFlags]

The flag for each point in Self::points.

Source

pub fn contours(&self) -> &[u16]

The index of the last point of each contour.

Source

pub fn phantom_points(&self) -> &[Point<C>; 4]

The four phantom points, after scaling, variation and hinting.

Source

pub fn adjusted_lsb(&self) -> C

The left side bearing after scaling, variation and hinting.

Source

pub fn adjusted_advance_width(&self) -> C

The advance width after scaling, variation and hinting.

Source

pub fn to_path(&self, start: PathContourStart, sink: &mut impl PathSink) -> bool

Converts the outline to path commands, calling sink for each.

start decides where a contour begins when its first point is off-curve. The point stream leaves that open.

Returns false if the points do not describe a path, on the same terms as outline_to_path.

Trait Implementations§

Source§

impl<'a, C: Clone + PointCoord> Clone for OutlineRef<'a, C>

Source§

fn clone(&self) -> OutlineRef<'a, C>

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<'a, C: Debug + PointCoord> Debug for OutlineRef<'a, C>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, C> Freeze for OutlineRef<'a, C>
where C: Freeze,

§

impl<'a, C> RefUnwindSafe for OutlineRef<'a, C>
where C: RefUnwindSafe,

§

impl<'a, C> Send for OutlineRef<'a, C>
where C: Send + Sync,

§

impl<'a, C> Sync for OutlineRef<'a, C>
where C: Sync,

§

impl<'a, C> Unpin for OutlineRef<'a, C>
where C: Unpin,

§

impl<'a, C> UnsafeUnpin for OutlineRef<'a, C>
where C: UnsafeUnpin,

§

impl<'a, C> UnwindSafe for OutlineRef<'a, C>

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.