SubsetPlan

Struct SubsetPlan 

Source
pub struct SubsetPlan<'f, 'b> { /* private fields */ }
Expand description

Information about how a subsetting operation will be executed.

This includes e.g. how glyph ids are mapped from the original font to the subset.

Implementations§

Source§

impl<'f, 'b> SubsetPlan<'f, 'b>

Source

pub fn subset(&self) -> Result<FontFace<'b>, SubsettingError>

Executes the subsetting plan.

Source

pub fn unicode_to_old_glyph_mapping(&self) -> &Map<'_, char, u32>

Returns the mapping between codepoints in the original font and the associated glyph id in the original font.

Source

pub fn new_to_old_glyph_mapping(&self) -> &Map<'_, u32, u32>

Returns the mapping between glyphs in the subset that will be produced by plan and the glyph in the original font.

Source

pub fn old_to_new_glyph_mapping(&self) -> &Map<'_, u32, u32>

Returns the mapping between glyphs in the original font to glyphs in the subset that will be produced by plan.

Source§

impl<'f, 'b> SubsetPlan<'f, 'b>

Source

pub fn into_raw(self) -> *mut hb_subset_plan_t

Converts the subset plan into raw sys::hb_subset_plan_t pointer.

This method transfers the ownership of the subset plan to the caller. It is up to the caller to call sys::hb_subset_plan_destroy to free the pointer, or call Self::from_raw to convert it back into SubsetPlan.

Source

pub fn as_raw(&self) -> *mut hb_subset_plan_t

Exposes the raw inner pointer without transferring the ownership.

Unlike Self::into_raw, this method does not transfer the ownership of the pointer to the caller.

Source

pub unsafe fn from_raw(plan: *mut hb_subset_plan_t) -> Self

Constructs a subset plan from raw sys::hb_subset_plan_t pointer.

§Safety

The given plan pointer must either be constructed by some Harfbuzz function, or be returned from Self::into_raw.

Trait Implementations§

Source§

impl<'f, 'b> Drop for SubsetPlan<'f, 'b>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'f, 'b> Freeze for SubsetPlan<'f, 'b>

§

impl<'f, 'b> RefUnwindSafe for SubsetPlan<'f, 'b>

§

impl<'f, 'b> !Send for SubsetPlan<'f, 'b>

§

impl<'f, 'b> !Sync for SubsetPlan<'f, 'b>

§

impl<'f, 'b> Unpin for SubsetPlan<'f, 'b>

§

impl<'f, 'b> UnwindSafe for SubsetPlan<'f, 'b>

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.