pub struct PatchGroup<'a> { /* private fields */ }Expand description
A group of patches derived from a single IFT font.
This is a group which can be applied simultaneously to that font. Patches are initially missing data which must be fetched and supplied to patch application method.
Also optionally includes a list of patches which are not compatible but have been requested to be preloaded.
Implementations§
Source§impl PatchGroup<'_>
impl PatchGroup<'_>
Sourcepub fn select_next_patches<'b>(
ift_font: FontRef<'b>,
patch_data: &HashMap<PatchUrl, UrlStatus>,
subset_definition: &SubsetDefinition,
) -> Result<PatchGroup<'b>, ReadError>
pub fn select_next_patches<'b>( ift_font: FontRef<'b>, patch_data: &HashMap<PatchUrl, UrlStatus>, subset_definition: &SubsetDefinition, ) -> Result<PatchGroup<'b>, ReadError>
Intersect the available and unapplied patches in ift_font against subset_definition
patch_data provides any patch data that has been previously loaded, keyed by patch url. May be empty if no patch data is loaded yet.
Returns a group of patches which would be applied next.
Sourcepub fn urls(&self) -> impl Iterator<Item = &PatchUrl>
pub fn urls(&self) -> impl Iterator<Item = &PatchUrl>
Returns an iterator over URLs in this group.
Sourcepub fn has_urls(&self) -> bool
pub fn has_urls(&self) -> bool
Returns true if there is at least one url associated with this group.
pub fn next_invalidating_patch(&self) -> Option<&PatchInfo>
Sourcepub fn apply_next_patches(
self,
patch_data: &mut HashMap<PatchUrl, UrlStatus>,
) -> Result<Vec<u8>, PatchingError>
pub fn apply_next_patches( self, patch_data: &mut HashMap<PatchUrl, UrlStatus>, ) -> Result<Vec<u8>, PatchingError>
Attempt to apply the next patch (or patches if non-invalidating) listed in this group.
Returns the bytes of the updated font.
Sourcepub fn apply_next_patches_with_decoder<D: SharedBrotliDecoder>(
self,
patch_data: &mut HashMap<PatchUrl, UrlStatus>,
brotli_decoder: &D,
) -> Result<Vec<u8>, PatchingError>
pub fn apply_next_patches_with_decoder<D: SharedBrotliDecoder>( self, patch_data: &mut HashMap<PatchUrl, UrlStatus>, brotli_decoder: &D, ) -> Result<Vec<u8>, PatchingError>
Attempt to apply the next patch (or patches if non-invalidating) listed in this group.
Returns the bytes of the updated font.
Trait Implementations§
Source§impl<'a> Clone for PatchGroup<'a>
impl<'a> Clone for PatchGroup<'a>
Source§fn clone(&self) -> PatchGroup<'a>
fn clone(&self) -> PatchGroup<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more