class HexaPDF::Layout::TextShaper


This class is used to perform text shaping, i.e. changing the position of glyphs (e.g. for kerning) or substituting one or more glyphs for other glyphs (e.g. for ligatures).

Status of the implementation:

  • All text shaping functionality possible for Type1 fonts is implemented, i.e. kerning and ligature substitution.

  • For TrueType fonts only kerning via the ‘kern’ table is implemented.

Public Instance Methods


Shapes the given text fragment in-place.

The following shaping options, retrieved from the text fragment’s Style#font_features, are supported:


Pair-wise kerning.


Ligature substitution.