Skip to main content

Module shape

Module shape 

Source

Structs§

ClusterGroup 🔒
Internal: one HarfBuzz cluster’s worth of primary-shaped glyphs plus the cluster’s source byte range.
ClusterResolution 🔒
Internal: one cluster’s resolution after fallback retry. glyphs carry cluster offsets into the parent word text.
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.
group_clusters 🔒
Walk a rustybuzz-ordered LTR glyph stream and group consecutive glyphs sharing the same cluster value. Each group’s byte range is [c..c_next) where c_next is the next cluster’s start (or text_len for the last cluster). The shaper currently forces LTR; RTL support must revisit this monotonic-cluster assumption.
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.