swash::shape

Struct ShaperBuilder

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

Builder for configuring a shaper.

See the module level documentation for more detail.

Implementations§

source§

impl<'a> ShaperBuilder<'a>

source

pub fn script(self, script: Script) -> Self

Specifies the script. The default value is Script::Latin.

source

pub fn language(self, language: Option<Language>) -> Self

Specifies the language. The default value is None.

source

pub fn direction(self, direction: Direction) -> Self

Specifies the text direction. The default value is Direction::LeftToRight.

source

pub fn size(self, ppem: f32) -> Self

Specifies the font size in pixels per em. The default value is 0 which will produce glyphs with offsets and advances in font units.

source

pub fn features<I>(self, settings: I) -> Self
where I: IntoIterator, I::Item: Into<Setting<u16>>,

Adds feature settings to the shaper.

source

pub fn variations<I>(self, settings: I) -> Self
where I: IntoIterator, I::Item: Into<Setting<f32>>,

Adds variation settings to the shaper.

source

pub fn normalized_coords<I>(self, coords: I) -> Self

Specifies the variation settings in terms of normalized coordinates.

source

pub fn insert_dotted_circles(self, yes: bool) -> Self

Specifies whether to insert dotted circles for broken clusters. The default value is false.

source

pub fn retain_ignorables(self, yes: bool) -> Self

Specifies whether characters defined as default ignorable should be retained by the shaper. The default is false.

source

pub fn build(self) -> Shaper<'a>

Builds a shaper for the current configuration.

Auto Trait Implementations§

§

impl<'a> Freeze for ShaperBuilder<'a>

§

impl<'a> RefUnwindSafe for ShaperBuilder<'a>

§

impl<'a> Send for ShaperBuilder<'a>

§

impl<'a> Sync for ShaperBuilder<'a>

§

impl<'a> Unpin for ShaperBuilder<'a>

§

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