Back to API Reference
Class
BaseModifier
abstract
Base class for text modifiers — pieces of logic that alter appearance, layout, or behavior of a text range matched by an IParseRule.
Remarks
Subclass and override the protected hooks (
OnEnable, OnDisable, OnDestroy, OnApply, optionally PrepareForParallel). Lifecycle dispatching is driven by the framework (Style, the parse pipeline, CompositeModifier) — user code instantiates modifiers and hands them to Style; it should not invoke the lifecycle itself. Cycle (per parse pass on a UniText component): OnEnable runs once when the modifier first participates in a cycle — allocate pooled buffers and subscribe to UniText events here. OnApply runs for every tag/range matched in the current text. OnDisable runs at the start of the next cycle to unsubscribe event handlers; allocated buffers should stay alive so the next OnEnable can reuse them. OnDestroy runs when the modifier is removed from the component (style changed, font reload, component destroyed) — release pooled buffers and any other resources OnEnable acquired. Guaranteed to run exactly once per OnEnable-initiated resource acquisition, even when an intervening OnDisable has already cleared the subscription state.Derived Types(34)
Types that inherit from BaseModifier.
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
AlignmentModifier
Sets horizontal alignment, justify mode, and last-line alignment for the paragraphs it covers. Apply whole-text or per range/tag — each paragraph can differ.
BaseLineModifier
Base class for modifiers that render horizontal lines across text (underline, strikethrough).
BoldModifier
Applies bold styling to text using CSS font-weight scale (100-900).
CompositeModifier
Combines multiple modifiers into a single modifier.
DirectionModifier
Sets the paragraph base writing direction (UAX #9). Apply whole-text.
EffectModifier
Base class for modifiers that append duplicate glyph geometry behind or in front of the face (outline, shadow, extrude, glow, custom effects).
EllipsisModifier
Truncates text that overflows its container and appends an ellipsis (...).
EmptyModifier
A no-op modifier that performs no action.
FontModifier
Overrides the font used for a text range by selecting a [[FontFamily]] from the component's [[UniTextFontStack]] by its [[name]].
FontSizeMatchModifier
Normalizes mixed fonts to a common visual size by matching x-height or cap-height (CSS font-size-adjust). Target 0 = match the primary font; >0 = match that aspect value (metric ÷ font size) for every font. Apply whole-text.
GlyphModifier<T>
Base class for modifiers that store per-glyph attribute data.
GradientModifier
Applies gradient coloring to text ranges using named gradients.
IndentModifier
Adds left indentation that begins where the tag opens and persists across wrapped lines until the tag closes.
InlineMediaModifier<TEntry, TWrapper>
Shared base for modifiers that embed inline-flowed media (prefab instances, sprite quads, future GPU mesh subitems) into text. Subclasses pick the entry type and wrapper type, supply a typed provider field, and translate entries into wrapper state — the base owns the cluster mapping, shape/render passes, lifecycle of wrapper instances, and provider event subscription.
InteractiveModifier
Base class for modifiers that create interactive (clickable/hoverable) text ranges.
ItalicModifier
Renders italic by slanting glyphs. Without a parameter (auto) the pipeline prefers a real italic face (family cut, variable ital/slnt axis, or OS fallback) and shears synthetically only when none exists. Parameters override that: a number sets an explicit synthetic slant (<i=20>), f (<i=f>) synthesizes from the run font's own [[ItalicStyle]], and r (<i=r>) uses a real italic face only — never synthesizes, leaving the text upright when none is available.
LanguageModifier
Applies a BCP 47 language tag to a text range for OpenType-aware shaping.
LetterSpacingModifier
Applies character spacing (tracking) adjustments to text ranges.
LineHeightModifier
Sets each line's height, per paragraph.
ListModifier
Renders list markers (bullets or numbers) for text items with automatic indentation.
LowercaseModifier
Transforms text to lowercase within marked ranges.
ParagraphSpacingModifier
Adds vertical spacing between paragraphs (text separated by line breaks).
RangeCollectingModifier
Base for modifiers that collect codepoint ranges during apply and act on them in the Shaped phase — the channel through which a modifier influences wrapping. Subclasses implement [[ApplyRange]].
RevealModifier
Shows only the leading part of each covered range and hides the rest — the engine piece behind typewriter-style text reveal.
RubyModifier
Sets ruby (furigana) — small annotation text placed above a base run to show its reading or meaning, as used in Japanese and other East-Asian typography.
ScriptPositionModifier
Applies superscript or subscript formatting to text ranges.
SizeModifier
Applies font size changes to text ranges.
SmallCapsModifier
Renders lowercase letters as small capitals.
SubMeshModifier
Base class for modifiers that emit a separate, owner-controlled sub-mesh rendered by its own CanvasRenderer with a user-supplied material (see [[MaterialModifier]]).
TextBoxTrimModifier
Trims vertical space above/below text to chosen metrics (CSS text-box-trim/text-box-edge): e.g. cap-height + baseline for optically centered UI labels. Apply whole-text.
UppercaseModifier
Transforms text to uppercase within marked ranges.
VariationModifier
Controls variable font axis values per text range.
WobbleAnimationModifier
Applies a sine-wave wobble animation to text by oscillating glyph vertices vertically.
WordSpacingModifier
Adjusts the gap at spaces between words (the regular space and no-break space), leaving letter-to-letter spacing untouched. The CSS word-spacing analogue.
protected UniTextBase uniTextThe UniText component this modifier is bound to. Assigned by the framework via SetOwner; available to subclasses from OnEnable onward.
protected UniTextBuffers buffersShared text-processing buffers (codepoints, runs, shaped glyphs, attribute storage). Assigned by the framework alongside uniText.
