Skip to main content

Module shape

Module shape 

Source

Structs§

ClusterResolution 🔒
Internal: one cluster’s resolution after fallback retry. glyphs carry cluster offsets into the parent word text.
GlyphCluster
A borrowed group of consecutive glyphs sharing a source byte offset.
ShapedRun
Output of shape_text: the shaped glyph stream and the total advance width at the requested point size.
WordSubRun
One face’s slice of a per-glyph-fallback shaping result.

Functions§

embedded_upem 🔒
units_per_em for an embedded face.
finalize_subrun 🔒
Convert a (font, byte_range, parent-relative glyphs) triple into a fully-baked WordSubRun: slices parent_text to the sub-run’s local string, rebases glyph clusters to that local string, sums the advance.
glyph_clusters
Iterate over a left-to-right shaped glyph stream without allocating or copying glyphs.
into_subrun 🔒
Single-sub-run packaging when no fallback retry was needed. Skips the rebasing branch: the input glyphs already have cluster offsets relative to local_text (which is the full parent text).
shape_text
Shape text against font.
shape_with_fallback
Shape text against primary with per-glyph fallback.
split_runs_at
Split shaped runs at a byte offset in their concatenated WordSubRun::text.