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>
impl<'f, 'b> SubsetPlan<'f, 'b>
Sourcepub fn subset(&self) -> Result<FontFace<'b>, SubsettingError>
pub fn subset(&self) -> Result<FontFace<'b>, SubsettingError>
Executes the subsetting plan.
Sourcepub fn unicode_to_old_glyph_mapping(&self) -> &Map<'_, char, u32>
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.
Sourcepub fn new_to_old_glyph_mapping(&self) -> &Map<'_, u32, u32>
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.
Sourcepub fn old_to_new_glyph_mapping(&self) -> &Map<'_, u32, u32>
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>
impl<'f, 'b> SubsetPlan<'f, 'b>
Sourcepub fn into_raw(self) -> *mut hb_subset_plan_t
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.
Sourcepub fn as_raw(&self) -> *mut hb_subset_plan_t
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.
Sourcepub unsafe fn from_raw(plan: *mut hb_subset_plan_t) -> Self
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.