UniTextBuffers
Container for all intermediate and final buffers used during text processing.
Remarks
PooledBuffer<T> for zero-allocation operation in steady state. Call EnsureRentBuffers before processing and EnsureReturnBuffers when done.public ReadOnlySpan<bool> GraphemeBreaksOrEmpty{ get }graphemeBreaks as a span, or empty until the pipeline has produced them — the one place the not-ready check lives.
public ReadOnlySpan<bool> WordBoundariesOrEmpty{ get }wordBoundaries as a span, or empty until the pipeline has produced them.
Requests atlas warm-up for a codepoint rendered outside the document text (decoration-line _, list bullets, ellipsis). The glyph is prepared in every font the text resolves to, so an injected character can be drawn in the face of the text around it, plus the font stack's own choice for it. Deduplicated — the buffer is shared across modifiers and survives granular re-applies, so a per-range or per-frame caller must not append the same codepoint unboundedly.
public bool TryResolveInjectedGlyph(UniTextFontProvider fontProvider, uint codepoint, int cluster, float fontSize)Resolves a character drawn outside the document text against the face the text at cluster resolved to, so a bold, italic, overridden or variable face carries into the injected glyph; falls back to the font stack when that face lacks the character. Declare the character through RequestVirtualCodepoint in any phase before glyph rasterization, or the resolved glyph has no atlas entry to draw from.
public AttributeChannel ActivateChannel(string key, BaseModifier holder, UniTextBase owner, Func<AttributeChannel> factory)Registers holder as an active writer of key and returns the channel owning that key's pipeline passes, creating it from factory on the first writer. Returns when the key carries no pass.
Gets or creates typed attribute data for the specified key, incrementing its reference count. The matching ReleaseAttributeData call decrements; the underlying data is freed only when the count reaches zero. This lets multiple modifier instances safely share one keyed channel — destroying one no longer pulls the buffer out from under the rest.
public void AddFontFeatures(TextRange range, byte featureSet)Merges an OpenType feature set into every codepoint of a range, so shaping applies it there. Features already written to a codepoint are kept, and a tag both sets carry takes featureSet's value. Unset writes nothing.
Sizes every registered attribute to the current codepoint count and clears it. Runs once per parse, after decoding and before any modifier applies: an attribute owned by a modifier that did not re-initialize this parse is still indexed by the codepoints of the current text.
public PooledBuffer<TextRun> runsPre-shaping runs (segmented by script, direction, font) — per-pass scratch of the paragraphs that actually re-shaped; cache-hit paragraphs contribute none. Read only by shaping; consume shapedRuns for whole-text run data.
public PooledBuffer<ShapedRun> shapedRunsShaped runs with glyph ranges and metrics.
public PooledBuffer<ShapedGlyph> shapedGlyphsShaped glyphs with glyph IDs, advances, and offsets.
public PooledBuffer<LineBreakType> breakOpportunitiesLine break types per codepoint (UAX #14).
public PooledBuffer<TextLine> linesComputed text lines after line breaking.
public PooledBuffer<ShapedRun> orderedRunsRuns reordered for visual display within each line.
public PooledBuffer<PositionedGlyph> positionedGlyphsFinal positioned glyphs ready for rendering.
public PooledBuffer<TextRange> segmentBreaksSegment-level line break opportunities in codepoint space; filled by modifiers in the Shaped phase, consumed by line breaking. Text between consecutive entries wraps as a unit: it either fits entirely on the current line or starts a fresh one, and the entry's range — the delimiter — collapses when the break is taken on it (its codepoints stay in the line range but produce no glyphs and no width), the way trailing whitespace hangs at word-level breaks. A unit wider than the box wraps inside itself, and its lines accept no further units. A zero-length entry is a pure boundary with nothing to collapse.
public PooledBuffer<VirtualGlyph> virtualGlyphsPre-shaped glyph ids (with font) modifiers request for atlas rasterization when the id comes from OpenType shaping (GSUB), not a 1:1 codepoint lookup.
public PooledBuffer<PositionedGlyph> virtualPositionedGlyphsVirtual positioned glyphs injected by modifiers (ellipsis, list markers). Separate from positionedGlyphs to not affect hit testing / selection.
public PooledBuffer<UnicodeScript> scriptsUnicode script per codepoint (UAX #24).
public TextDirection baseDirectionThe resolved base paragraph direction.
