Docsv3.5.11
Back to API Reference
Class

PaintOrderModifier

sealed
Inherits:BaseModifier

Sets the painter order of a range's paint layers (PaintOrder): layer-major (the component default) draws each layer across all glyphs before the next layer; glyph-major composites every layer of one glyph before the next glyph, so a later glyph's stroke or shadow overlaps earlier glyphs' fill; reverse stacks a glyph-major range front to back instead, so earlier glyphs overlap later ones. The axis is a single per-component channel — all layer modifiers follow it, overlapping ranges resolve innermost-wins, and unmarked text stays layer-major. Characters connected by the Unicode cursive joining algorithm (Arabic, Syriac, N'Ko, Mongolian, …) never split: each connected stretch keeps layer order and composites as one unit, so glyph-major Arabic stacks per word rather than per letter.

Remarks

Applies to same-material quads of the base mesh. Separate-material output (texture paints, the color-glyph segment) always stacks layer-major, and a blend-mode change between adjacent glyph-major quads splits the draw. Stylistic connected Latin fonts (script typefaces joining via ligatures and contextual alternates) carry no data signal that marks them cursive; their connections are not detected.
public PaintOrder Order{ get; set }

Painter order applied when the markup carries no value. Defaults to glyph-major — the mode the tag exists to enable; pass layer to restore layer order inside a glyph-major range.

public bool Reverse{ get; set }

Stacks glyph-major glyphs front to back — an earlier glyph's stroke or shadow overlaps later glyphs — when the markup carries no value. Layer order has no direction and ignores it.

protected override void OnEnable()
protected override void OnDestroy()
protected override void BeforeApply()

The winner buffer holds packed range bounds from the previous cycle; a granular re-apply replays every range, so stale winners must not out-compete the replayed stamps.

protected override void OnApply()

Stamps the range's resolved order into the shared per-codepoint axis (paintOrders); overlapping ranges resolve innermost-wins through packed (start, end) winner entries. Glyph-major stamping is joining-aware: a character cursively connected to a neighbour (Transparent characters skipped, edges probed past the range bounds) keeps layer order, and Transparent characters inherit their base's mode so a connected stretch stays one contiguous composition group. A reversed range carries PaintOrderReversed on every stamp, connected stretches included, so the mesh generator mirrors the range as a whole.