Skip to main content

subset

Function subset 

Source
pub fn subset(font: &EmbeddedFont, gids: &[u16]) -> Result<Vec<u8>, SubsetError>
Expand description

Subset font to just the glyph IDs in gids (always include GID 0, .notdef, which the PDF spec mandates). Returns the trimmed TTF bytes suitable for embedding as a /FontFile2 stream.

§Errors

Returns an error if the font’s tables are malformed or use features the underlying [subsetter] crate doesn’t support (CFF2). The bundled Noto Sans cuts are TrueType-flavoured and exercise the well-supported path.