API Reference
Complete documentation for all public types in UniText 3.3.0.
Components
Text components and their entry points
UniText
classCanvas-space text component. Renders into a [[Canvas]] via [[CanvasRenderer]] with full Unicode support — bidirectional scripts (Arabic, Hebrew), complex shaping (Devanagari, Thai), proper line breaking, color emoji, and a markup system via [[ParseRule]].
UniTextWorld
classWorld-space text component. Renders via [[UniTextWorldBatcher]] with full Unicode support — bidirectional scripts, complex shaping, color emoji, markup.
UniTextBase
classShared base for UniText components — handles text processing (Unicode, BiDi, shaping, line breaking, modifiers, emoji, font fallback, variable fonts). Concrete subclasses supply the rendering backend: [[UniText]] (Canvas) and [[UniTextWorld]] (world-space).
UniTextAnimationBridge
classBridges a Unity Animator to a [[UniTextBase]]: Animator writes hit serialized fields directly and bypass the property setters that normally invalidate the text pipeline, so this turns them back into the correct [[UniTextDirty]] invalidation.
BlockingObjects
enumPhysics systems consulted for occlusion between the camera and a text hit.
CachedTransformData
structSnapshot of main-thread state captured before parallel processing — Unity APIs ([[rect]], etc.) cannot be touched from worker threads.
Markup
Markup parsing, parse rules and text ranges
TagRule
classUniversal tag parse rule configured via a serialized tag name. Replaces all individual tag parse rule classes (BoldParseRule, ColorParseRule, etc.).
TagParseRule
classBase class for parsing XML-style markup tags (e.g., <b>, <color=#FF0000>).
CompositeParseRule
classCombines multiple parse rules into a single rule.
StringParseRule
classMatches literal string patterns and optionally replaces them.
RangeSource
classBase class for serialized and runtime producers of text range entities.
ParsedRange
structRepresents a parsed text range with associated tag information.
Modifiers
Modifiers, styles and style presets
BaseModifier
classBase class for logic that alters the appearance, layout, semantics, or behavior of ranges emitted by a [[RangeSource]].
Style
classLinks a range source with the modifier graph applied to its entities.
StylePreset
classShareable, project-asset container of [[Style]] entries that components apply in bulk via [[StylePresets]] or via [[GlobalStylePreset]].
AlignmentModifier
classSets horizontal alignment, justify mode, and last-line alignment for the paragraphs it covers. Apply whole-text or per range/tag — each paragraph can differ.
AllRangeStateSelector
classMatches only when every child selector matches.
AnyRangeStateSelector
classMatches when at least one child selector matches.
Paint
Fills, gradients, glow, shadows and other paint layers
AssetPaintProvider
class[[IPaintProvider]] backed by an explicit [[UniTextPaints]] asset reference.
BaseLineModifier
classBase class for modifiers that render horizontal lines across text (underline, strikethrough).
BaseRangeDecorationModifier
classBase class for modifier-authored geometry attached to final visual text ranges. It owns range accumulation, paint resolution, renderer handles and main-thread rebuild timing; subclasses only translate one immutable [[RangeDecorationContext]] into a [[RangeMeshWriter]].
CornerStyle
enumHow a layer's offset iso-lines treat glyph corners.
CoverageMode
classCoverage-mode codes written to TEXCOORD2.x. Must match UniText_Coverage.hlsl.
CoverageQuadOps
classWrites the unified paint vertex contract — colour, coverage (TEXCOORD2) and paint (TEXCOORD3) — into a reserved quad whose positions/UV0/UV1 were already copied from the glyph template by [[ReserveQuad]]. One writer shared by every layer kind so the contract lives in a single place.
Animation
Animated modifiers, reveal handlers and Animator integration
AnimationHandler
classOne Animator-driven diff unit on a [[UniTextAnimationBridge]]. A Unity Animator writes serialized fields directly, bypassing the property setters that normally raise [[UniTextDirty]]; a handler caches a baseline of the values it watches and, after each apply, re-issues the invalidation those setters would have.
AssetRevealHandlerProvider
classResolves names through an explicit [[UniTextRevealHandlers]] asset reference.
BounceModifier
classPeriodic hops off the baseline: glyphs jump and land with a sharpened half-sine, staying put between hops. Drive [[Phase]] to animate.
BurstRevealHandler
classLaunches glyphs from deterministic radial directions into their final cells.
ChaosRevealHandler
classCombines deterministic direction, scale, rotation and colour variation per glyph.
CompositeRevealHandler
classApplies several reveal handlers in authored order while occupying one modifier slot.
Fonts
Fonts, faces, glyphs and atlases
UniTextFont
classSerialized font definition that owns face and rendering metadata and resolves its immutable source lazily. Embedded sources stay in the asset in the Editor and WebGL; other players resolve build-generated disk-backed sources. The [[Core]] materializes only when glyph or shaping work first needs this face.
UniTextFontStack
classOrdered list of font families plus an optional fallback stack. The first family's primary provides strut metrics (line height, ascent, descent). Face matching uses pre-computed lookup tables with CSS Fonts Level 4 §5.2 weight matching.
FontFamily
structA font family: primary font plus optional variant faces (Bold, Italic, Variable, etc.).
UniTextFontProvider
classOwns Unicode-sequence font resolution for a text object: composes the family chain from the assigned font and font stack, walks it (plus emoji and the always-on [[SystemFont]] fallback) to pick a covering runtime and exact variation instance when available, and otherwise returns the primary runtime as the intentional.notdef endpoint. Asset-backed faces are captured as worker-safe lazy slots; bare runtime companions and the emoji singleton flow through the same resolution path. The owner must dispose the provider after all processing and raster work finishes.
AxisDefault
structOne variable-font axis pinned to a custom default value, keyed by its OpenType tag (4-char tag packed big-endian, same bits as the HarfBuzz uint tag).
Core
classPlain runtime for a font: owns face access, glyph tables, lookup dictionaries, curve cache and atlas pipeline. Constructable on worker threads (no Unity object lifecycle). Dispose instances constructed directly; a [[UniTextFont]] owns and disposes the runtime exposed by its asset.
Layout
Shaping, line layout, alignment and hit testing
TextProcessor
classProcesses Unicode text through script analysis, BiDi reordering, shaping, and layout.
TextLayout
classPositions glyphs within the layout bounds based on line breaking results and alignment settings.
LayoutSettings
structConfiguration for text layout and positioning.
TextProcessSettings
structConfiguration settings for text processing operations.
Shaper
classText shaper that converts codepoints to positioned glyphs through a runtime font face. SFNT-backed fonts use HarfBuzz for full OpenType shaping; platform-native faces supply equivalent glyph and positioning results through their backend.
TextLine
structRepresents a line of text after line breaking.
Editing
Input behaviors, filters, validation and text documents
UniTextEditable
classEditing capability for [[UniTextSelectable]]: text storage (gap buffer), undo/redo, IME composition, validators, caret rendering, input intents, touch gesture pipeline, keyboard / clipboard handling, and the public mutation API (InsertText, Cut/Copy/Paste, Undo/Redo, etc.).
InputBehavior
classBase class for composable input policies attached to a [[UniTextEditable]].
InputBehaviorPreset
classShareable, project-asset container of [[InputBehavior]] entries that editors apply in bulk via [[BehaviorPresets]] — one asset defines a field archetype (chat composer, form field, password) reused across scenes. Each editor instantiates a runtime copy, so per-instance behavior state never leaks into the asset.
FieldDecorator
classBase class for state-driven field visuals: placeholder, floating label, supporting text, character counter, or validation feedback. It participates in the ordinary [[InputBehavior]] lifecycle and appears in the editor's behavior type picker.
ITextDocument
interfaceRead-only view of a text document with codepoint-indexed access. Implemented by [[UniTextEditable]]; consumed by generic text-aware features (find / replace, validators, accessibility readers) that should not depend on the concrete editor type.
AlphanumericFilter
classFilters alphanumeric input: Unicode letters and ASCII digits [0-9].
Selection
Selection, caret, touch handles and context menus
UniTextSelectable
classSelection capability for [[UniTextBase]]: caret + range state with explicit affinity, gesture interpretation (multi-click promotion, drag-to-select, word-by-word drag, context-menu coordination), and highlight rendering. Sits on the same GameObject as [[UniTextBase]]; requires an existing [[UniText]] or [[UniTextWorld]] — [[RequireComponent]] validates the dependency but cannot auto-add the abstract base, so add the text component first.
UniTextContextMenu
classText context menu you build yourself: lay out and style the panel, buttons, and toggles in the scene however you like, then list the [[ContextMenuItem]] bindings here — each maps one of your controls to a command. [[PrefabTextContextMenu]] drives it with the applicable capabilities, and standard commands route back to the presenter it passed. One menu is shareable across many fields — actions always reach the field that last showed it. The component only wires control events, shows / hides controls per applicability, positions the panel, and dismisses on an outside click — it draws nothing itself. Prefabs assigned to [[PrefabTextContextMenu]] use density-independent layout units.
ContextMenuItem
classOne entry of a [[UniTextContextMenu]]: the binding between a control you built in the scene (a Button, Toggle, …) and an action. The menu wires the control's event, and shows or hides the control per [[IsApplicable]]. Items carry no visuals — the control's look, layout, label, and icon are entirely yours. An item whose control is not assigned never counts as applicable, so an unwired menu cannot open as an invisible input-blocking panel.
UniTextSelectionHandles
classShipped Unity-UI presentation used by [[PrefabSelectionHandles]]. It instantiates a user-authored prefab for the draggable selection handles (one prefab used for both the anchor and focus carets) and for the collapsed-caret insertion handle, and places each at its caret point. The split of ownership: the prefab owns the look — sprite, colour, material, and the pivot, which alone decides how the handle sits relative to the caret (a teardrop pivots at its tip); the code owns the size, forcing each handle to a square of [[handleSize]] dp so the touch target stays a constant physical size across canvases, resolutions, and densities (a fingertip is device-independent). Put Preserve Aspect on the prefab's Image so its sprite fits that square undistorted. Assign its prefab inside a [[PrefabSelectionHandles]] entity; geometry is pulled from [[ActiveEditor]] at call time, the instances live in a canvas-level overlay so the field's RectMask2D never clips them, and a handle whose caret scrolls outside the field box hides until it returns. A [[SelectionHandleDragger]] (drag routing) and a [[FocusGuard]] (so grabbing a handle never defocuses the field) are ensured on each instance, so the prefab need only carry a raycastable Graphic.
UniTextMagnifier
classShipped Unity-UI presentation used by [[PrefabMagnifier]]: a rectangular panel showing a zoomed capture of the canvas around the focal point, re-rendered through a secondary camera with a zoomed projection matrix. Assign its prefab inside a [[PrefabMagnifier]] entity; the panel lives in a canvas-level overlay container so the field's RectMask2D never clips it.
ActionContextMenuItem
classBinds a button to a runtime callback. Set [[onlyWithSelection]] to hide it on a bare caret.
Interaction
Links, gestures, range actions and pointer-driven ranges
CameraRangeViewport
classReveals world-space ranges by panning a camera or configured camera rig in its view plane. It never changes zoom, projection, rotation or range layout.
CopyRangeTextAction
classCopies a resolved string through UniText's platform clipboard provider.
DragRangeGestureRecognizer
classClaims a custom drag after the shared pointer slop is exceeded.
InlineObjectPolicy
enumHow U+FFFC inline-object clusters participate in range hit geometry.
InteractiveModifier
classDeclares semantic interaction for ranges selected by a Style source. One per-component [[UniTextInteractions]] router owns input, geometry, overlap and pointer state; this modifier owns only authored policy, target events and optional default actions.
InteractiveRange
structRepresents a clickable / hoverable / long-pressable range within text.
Media
Inline sprites, objects and their providers
AssetObjProvider
class[[IObjProvider]] backed by an explicit [[UniTextObjects]] asset referenced on the modifier. Use this when multiple components should share the same inline-object catalog managed as a project asset.
AssetSpriteProvider
class[[ISpriteProvider]] backed by an explicit [[UniTextSprites]] asset referenced on the modifier. Use this when multiple components should share the same sprite catalog managed as a project asset.
InheritBool
enumTri-state bool override: [[Inherit]] falls back to the weaker layer's value (the catalog entry).
InlineMedia
classCommon entry-data base for inline-flowed media ([[InlineSprite]], [[InlineObject]]). Carries the name and shared presentation data; the renderable payload is added by the concrete subclass.
InlineMediaModifier<TEntry, TWrapper, TOverride>
classInline-media modifier with typed per-entry overrides.
InlineMediaModifier<TEntry, TWrapper>
classShared 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.
Clipboard
Copy and paste adapters, clipboard formats and schemas
BindEntry
structOne entry in the bind map: the modifier type plus its schema.
ClipboardCopyContext
classRead-only selection payload handed to [[SerializeCopy]].
ClipboardModifierBindMap
classStatic registry of per-type clipboard schemas: which HTML elements, Markdown delimiters, and canonical source tag each [[BaseModifier]] type speaks. The schema is type-level metadata — instances have no say in it — so it lives here, not on the modifier: modifiers stay clipboard-ignorant, registration is explicit (no assembly scan, nothing for IL2CPP stripping to break), and the first paste costs nothing. Built-ins are pre-registered; integrator modifiers join via [[Register{T}]].
ClipboardPasteContent
classVisible paste text and its resolved destination formatting.
ClipboardPasteContext
classRead-only payload handed to [[DeserializePaste]]. Carries the editor so adapters can resolve external formatting against the destination's styles.
ClipboardSpan
structOne persistent formatting annotation clipped to UTF-16 coordinates within [[VisibleText]].
Emoji
Color emoji fonts
EmojiFont
classPlatform system emoji provider. Owns the primary face and any platform fallback faces required by individual emoji clusters.
SystemEmojiFont
classUtility for locating file-addressable system emoji fonts across platforms.
ColorFontCore
classRuntime for a color font (CBDT/sbix bitmap or COLRv0/COLRv1 vector). Plain [[Core]] subclass — not a ScriptableObject; constructable on worker threads. Owns the color-glyph rasterization pipeline: color-format detection, FreeType/Blend2D rendering into the shared color atlas, and color glyph metrics. The system emoji font ([[EmojiFont]]) and the [[UniTextColorFont]] asset are both built on this base.
Platform
Native input, IME and clipboard backends
UniTextClipboard
classCross-platform system-clipboard access. Routes through [[Provider]] to the active [[IClipboardProvider]]; convenience static methods on this class cover the plain-text fast path that most integrators need.
UniTextNativeInput
classFacade for native producer lifecycles and software-keyboard notifications.
ClipboardFormat
structCross-platform identifier for a clipboard payload. The canonical identifier is a MIME-style string (text/plain, text/html, text/uri-list); each platform clipboard provider translates to the correct OS-level identifier at the boundary (UTI on Apple, CF_HTML / "HTML Format" on Windows, MIME on Web / Android / Linux).
ClipboardItem
structA single (format, payload) pair on the clipboard. Multi-format writes pass a list of items in one atomic [[SetItems]] call; the OS stores them as a single clipboard write whose richest available format is selected by the consumer on paste.
CompositionClause
structA single clause (segment) within an IME composition string, with its boundaries and style.
CompositionClauseStyle
enumVisual classification of one clause in an IME composition.
Utilities
Attributes, Unicode data and helpers
DefaultParameterAttribute
classMarks a string field as a default parameter for a parse rule. Draws the opt-in parameter list generated from the paired modifier's [Parameter] fields.
GeneralCategory
enumUnicode General Category property values.
GenerateParametersAttribute
classEmits the modifier's parameter surface from its [[ParameterAttribute]] and [[SlotlessParameterAttribute]] fields: the nested Param descriptor class, Param.All, and the Descriptors override.
IWordSegmenter
interfaceScript-specific word segmenter used to tailor contextual scripts.
OptionsAttribute
classPopulates a string parameter field's dropdown from a registered parameter provider (e.g. "@paints", "@fonts") instead of a fixed enum.
ParameterAttribute
classMarks a serialized field as positional parameter metadata: its C# type, declaration order, name, and initializer drive the editor schema and runtime fallback.
