class HexaPDF::Font::TrueType::Subsetter


Subsets a TrueType font in the context of PDF.

TrueType fonts can be embedded into PDF either as a simple font or as a composite font. This subsetter implements the functionality needed when embedding a TrueType subset for a composite font.

This means in particular that the resulting font file cannot be used outside of the PDF.

Public Class Methods


Creates a new Subsetter for the given TrueType Font object.

Public Instance Methods


Builds the subset font file and returns it as a binary string.


Returns the new subset glyph ID for the given glyph ID, or nil if the glyph isn’t subset.


Includes the glyph with the given ID in the subset and returns the new subset glyph ID.

Can be called multiple times with the same glyph ID, always returning the correct new subset glyph ID.