Struct skrifa::outline::DrawSettings

source ·
pub struct DrawSettings<'a> { /* private fields */ }
Expand description

Options that define how a glyph is drawn to a pen.

Implementations§

source§

impl<'a> DrawSettings<'a>

source

pub fn unhinted(size: Size, location: impl Into<LocationRef<'a>>) -> Self

Creates settings for an unhinted draw operation with the given size and location in variation space.

source

pub fn hinted(instance: &'a HintingInstance, is_pedantic: bool) -> Self

Creates settings for a hinted draw operation using hinting data contained in the font.

If is_pedantic is true then any error that occurs during hinting will cause drawing to fail. This is equivalent to the FT_LOAD_PEDANTIC flag in FreeType.

The font size, location in variation space and hinting mode are defined by the current configuration of the given hinting instance.

source

pub fn with_memory(self, memory: Option<&'a mut [u8]>) -> Self

Builder method to associate a user memory buffer to be used for temporary allocations during drawing.

The required size of this buffer can be computed using the OutlineGlyph::draw_memory_size method.

If not provided, any necessary memory will be allocated internally.

source

pub fn with_path_style(self, path_style: PathStyle) -> Self

Builder method to control nuances of glyf pointstream interpretation.

Meant for use when trying to match legacy code behavior in Rust.

Trait Implementations§

source§

impl<'a> From<&'a HintingInstance> for DrawSettings<'a>

source§

fn from(value: &'a HintingInstance) -> Self

Converts to this type from the input type.
source§

impl<'a, L> From<(Size, L)> for DrawSettings<'a>
where L: Into<LocationRef<'a>>,

source§

fn from(value: (Size, L)) -> Self

Converts to this type from the input type.
source§

impl From<Size> for DrawSettings<'_>

source§

fn from(value: Size) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for DrawSettings<'a>

§

impl<'a> RefUnwindSafe for DrawSettings<'a>

§

impl<'a> Send for DrawSettings<'a>

§

impl<'a> Sync for DrawSettings<'a>

§

impl<'a> Unpin for DrawSettings<'a>

§

impl<'a> !UnwindSafe for DrawSettings<'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.