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. 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.
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.