API Reference
Complete documentation for all public types in UniText 2.12.12.
Core
Main components and 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 [[IParseRule]].
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).
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.
UniTextBuffers
classContainer for all intermediate and final buffers used during text processing.
Fonts
Font management and rendering
UniTextFont
classSerialized ScriptableObject wrapper around a runtime font [[Core]]. Stores font bytes, faceInfo and editor-tweakable settings; instantiates a Core on first [[Runtime]] access. The Core does all glyph work and is the type consumed by shaping/atlas code paths.
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 codepoint→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 runtime per codepoint, and stores [[Core]] instances so worker-thread companions and the emoji singleton (both plain Core, no Unity asset) flow through the same code path.
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: holds FT face, glyph table, lookup dictionaries, curve cache, atlas pipeline. Constructable on worker threads (no Unity object lifecycle).
Modifiers
Markup modifiers and effects
BaseModifier
classBase class for text modifiers — pieces of logic that alter appearance, layout, or behavior of a text range matched by an [[IParseRule]].
Style
classSerializable container that links a modifier with its parse rule. Tracks registration state and ownership to prevent bugs.
StylePreset
classShareable, project-asset container of [[Style]] entries that components apply in bulk via [[AddStylePreset]] or via [[GlobalStylePreset]].
ParsedRange
structRepresents a parsed text range with associated tag information.
InlineObject
classDefines an inline object (UI prefab) that can be embedded within text flow.
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.
Parse Rules
Custom parsing rules
IParseRule
interfaceInterface for custom text parsing rules that identify modifier application 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.
BackslashEscapeRule
classEscapes a single ASCII punctuation character preceded by \. Example: \* becomes a literal * and is protected from any other parse rule.
Emoji
Emoji support and rendering
Unicode
Unicode algorithms and text processing
UnicodeData
classProvides access to Unicode character properties and the global data provider.
GeneralCategory
enumUnicode General Category property values.
IWordSegmenter
interfaceInterface for script-specific word segmenters that inject break opportunities into SA-class (Complex Context Dependent) text runs.
LineBreakType
enumSpecifies the type of line break opportunity according to UAX #14.
LineRangeEntry
structA contiguous run of positioned glyphs within a single line whose clusters fall inside a queried range. Bounds are in local mesh coordinates (relative to the text origin), with X clamped to the line's visible content extent (trailing whitespace excluded per CSS Text §4.1.3 via [[width]]).
TextDirection
enumSpecifies the base text direction for bidirectional text processing.
Shaping
Text shaping and layout
Shaper
classText shaper that converts codepoints to positioned glyphs via HarfBuzz. Performs full OpenType shaping (GSUB/GPOS) including kerning, ligatures and mark positioning.
GradientShape
enumGradient projection mode. [[Linear]] projects vertex positions onto an axis, [[Radial]] uses distance from the range's centre, [[Angular]] sweeps a conic from the centre.
ShapedGlyph
structRepresents a shaped glyph with positioning information from the shaping engine.
ShapedRun
structRepresents a text run after shaping, with glyph information and metrics.
ShapingResult
structResult of a shaping operation containing glyphs and metrics.
Editor
Unity Editor integration and tools
DefaultParameterAttribute
classMarks a string field as a default parameter for a parse rule. Draws a toggle + rich parameter fields based on the paired modifier's ParameterFieldAttribute.
EscapeTextAreaAttribute
classHideFromTypeSelectorAttribute
classHides a type from the TypeSelector dropdown while keeping it deserializable.
ParameterFieldAttribute
classTypeDescriptionAttribute
classTypeGroupAttribute
classUtilities
Utility classes and helpers
AssetNamedCatalog<TEntry, TAsset>
classSerializable base for [[INamedCatalog{TEntry}]] implementations that delegate resolution to an explicit ScriptableObject asset reference — useful when multiple components should share the same catalog managed as a project asset.
INamedCatalog<TEntry>
interfaceResolves named entries by case-insensitive name. Used by every "named catalog" feature in UniText (gradients, inline sprites, inline-object prefabs) so the same set of providers — inline list, shared asset, custom code — composes across all of them.
IndexEx
classExtension methods for parsing [[Index]] from string representation.
InlineNamedCatalog<TEntry>
classSerializable base for [[INamedCatalog{TEntry}]] implementations that keep their entries inline on the owning modifier — edited in the inspector or mutated at runtime via [[SetEntries]], [[Add]], [[Remove]].
InputUtils
classBackend-agnostic input reads. Calling [[Input]] directly throws an [[InvalidOperationException]] every frame when the project's active input handling is set to the Input System package only; these route to Keyboard.current / Mouse.current in that configuration, to legacy Input otherwise.
NamedCatalogAsset<TEntry>
classAbstract ScriptableObject base for named-entry catalogs. Subclasses give the catalog a concrete entry type, a CreateAssetMenu path, and (optionally) a payload validity filter for editor enumeration.
