Skip to main content

Module shaping

Module shaping 

Source
Expand description

§OpenType Shaping

Wraps rustybuzz to perform OpenType shaping (GSUB/GPOS) on text. This produces real glyph IDs, kerning offsets, and ligature substitutions instead of the naive char-as-u16 glyph IDs used before.

Standard PDF fonts (Helvetica, Times, Courier) bypass shaping entirely — they use WinAnsi encoding and don’t have GSUB/GPOS tables.

Structs§

ShapedGlyph
A single glyph produced by OpenType shaping.

Functions§

cluster_widths
Compute per-cluster widths from shaped glyphs.
shape_text
Shape text using the given font data.
shape_text_with_direction
Shape text with explicit direction control.
shape_text_with_offset
Shape a segment of text for a specific font, returning shaped glyphs and a mapping from glyph index to character range.
shaped_width
Compute the total advance width of shaped glyphs in points.