apply_subsetting_to_chain

Function apply_subsetting_to_chain 

Source
pub fn apply_subsetting_to_chain(
    chain_family: FontFamily<FontFallbackChain>,
    text: &str,
) -> Result<FontFamily<FontFallbackChain>, Error>
Expand description

Applies font subsetting to a fallback chain to reduce PDF file size.

This function subsets each font in the chain (primary and all fallbacks) based on which characters from the document that font actually needs to render.

§Arguments

  • chain_family - The fallback chain family to subset
  • text - The document text to analyze for character usage

§Returns

A new FontFamily with subset fonts