Struct FeatureBuilder

Source
pub struct FeatureBuilder<'a> { /* private fields */ }
Expand description

A structure that allows client code to add additional features to the compilation.

Implementations§

Source§

impl<'a> FeatureBuilder<'a>

Source

pub fn language_systems(&self) -> impl Iterator<Item = LanguageSystem> + 'a

An iterator over the default language systems registered in the FEA

Source

pub fn gdef(&self) -> Option<&GdefBuilder>

If the FEA text contained an explicit GDEF table block, return its contents

Source

pub fn add_lig_carets( &mut self, lig_carets: BTreeMap<GlyphId16, Vec<CaretValue>>, )

Add caret positions for the GDEF LigCaretList table

Source

pub fn add_lookup<T: LookupSubtableBuilder>( &mut self, lookup: PendingLookup<T>, ) -> LookupId

Add a lookup to the lookup list.

The LookupId that is returned can then be included in features (i.e, passed to add_feature.)

Source

pub fn add_to_default_language_systems( &mut self, feature_tag: Tag, lookups: &[LookupId], )

Add lookups to every default language system.

Convenience method for recurring pattern.

Source

pub fn add_feature(&mut self, key: FeatureKey, lookups: Vec<LookupId>)

Create a new feature, registered for a particular language system.

The caller must call this method once for each language system under which a feature is to be registered.

Source

pub fn add_feature_variations( &mut self, features: Vec<Tag>, conditions: Vec<(ConditionSet, Vec<LookupId>)>, )

Add feature variations.

The variations will be added to each feature in tags.

For each feature tag:

  • if any FeatureRecords exist with that tag, the variations will be added to them.
  • if none exist, a new feature will be registered for the default language systems, and the variations will be added to these features.

Auto Trait Implementations§

§

impl<'a> Freeze for FeatureBuilder<'a>

§

impl<'a> RefUnwindSafe for FeatureBuilder<'a>

§

impl<'a> !Send for FeatureBuilder<'a>

§

impl<'a> !Sync for FeatureBuilder<'a>

§

impl<'a> Unpin for FeatureBuilder<'a>

§

impl<'a> !UnwindSafe for FeatureBuilder<'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<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

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.