Skip to main content

Outline

Struct Outline 

Source
pub struct Outline {
    pub pts: Vec<(f32, f32)>,
    pub tags: Vec<u8>,
    pub ends: Vec<u32>,
    pub err: bool,
    /* private fields */
}

Fields§

§pts: Vec<(f32, f32)>§tags: Vec<u8>§ends: Vec<u32>§err: bool

Implementations§

Source§

impl Outline

Source

pub fn reset(&mut self)

empty the buffer (owner cleared) [ol_reset]

Source

pub fn npts(&self) -> usize

Source

pub fn point(&mut self, x: f32, y: f32, tag: u8) -> bool

append a point (font units, OLT_*) [ol_point]

Source

pub fn reserve(&mut self, n: usize) -> Option<usize>

append n points (0, 0, OLT_OFF) to be filled in; the index of the first [ol_reserve]

Source

pub fn close(&mut self)

end the current contour [ol_close]

Source

pub fn contour(&mut self, last: u32) -> bool

end a contour at point index last (last < cstart: empty, ignored) [ol_contour]

Source

pub fn owner_set(&mut self, serial: u64, glyph: u32)

Source

pub fn owner_is(&self, serial: u64, glyph: u32) -> bool

Source

pub fn bbox(&self) -> Option<[i32; 4]>

control box {xmin, ymin, xmax, ymax} (floor / ceil, clamped to +-1e6) [ol_box]

Source

pub fn shear(&mut self, k: f32)

x += y * k [ol_shear]

Source

pub fn transform(&mut self, from: usize, a: f32, b: f32, c: f32, d: f32)

points from..n: (x, y) -> (a x + c y, b x + d y) [ol_transform]

Source

pub fn translate(&mut self, from: usize, dx: f32, dy: f32)

points from..n += (dx, dy) [ol_translate]

Source

pub fn embolden(&mut self, strength: f32)

FreeType FT_Outline_EmboldenXY(strength, strength): every edge moves outwards by strength / 2, the glyph grows up / right by strength [ol_embolden]

Source

pub fn emit(&self, path: &mut Path, gp: &Gp, zones: Option<&Zones>)

append every contour to the path (gp transform, composite offset dx / dy honoured; zones: FS_SHARP vertical fitting) [ol_emit]

Trait Implementations§

Source§

impl Default for Outline

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.