Docsv3.20.2

API Reference

Complete documentation for all public types in UniText 3.20.2.

638 types

Components

Text components and their entry points

View all 26

Markup

Markup parsing, parse rules and text ranges

View all 58

Modifiers

Modifiers, styles and style presets

View all 120

Paint

Fills, gradients, glow, shadows and other paint layers

View all 42

Animation

Animated modifiers, reveal handlers and Animator integration

View all 58

Fonts

Fonts, faces, glyphs and atlases

View all 23

UniTextFont

class

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

39 members3 derived

UniTextFontStack

class

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

4 members

FontFamily

struct

A font family: primary font plus optional variant faces (Bold, Italic, Variable, etc.).

8 members

UniTextFontProvider

class

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

28 members

AxisDefault

struct

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

2 members

Core

class

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

30 members1 derived

Layout

Shaping, line layout, alignment and hit testing

View all 53

Documents

Large documents: the rope, file and asset sources, the loader and the document view

View all 16

UniTextDocumentView

class

Provides a viewport, drag and wheel scrolling, inertia, elastic edges and optional scrollbars for Canvas text of any length; drives the text RectTransform to fill this view.

16 members

UniTextDocumentLoader

class

Loads a [[DocumentSource]] into a [[UniTextBase]] — on enable, whenever the source, any of its settings or the text changes, and on [[Reload]] — and hands the document over with ownership, so the text disposes it when it is replaced or destroyed. Inside a [[ScrollRect]] or under a mask the document scrolls and windows itself.

6 members

DocumentSource

class

Where a text component's document comes from. A source yields a [[Rope]] built for the scan profile of the text that renders it; the built-in sources read files, streaming assets and text assets, and a custom subclass appears in the inspector picker like any other. Every setting is state: a change publishes through the source, and a loader holding it reloads.

2 members2 derived

FileDocumentSource

class

A file addressed as a root folder plus a relative path. Roots the platform exposes as folders load synchronously through [[FileTextSource]]; roots that are URLs (streaming assets on Android and on the web) download and deliver later, which needs the built-in Unity Web Request module — without it a URL location fails to load.

10 members

TextAssetDocumentSource

class

A [[TextAsset]]'s bytes as the document. Unity holds the whole asset in memory, so this suits documents up to a few megabytes; larger files belong in streaming assets behind a [[FileDocumentSource]].

4 members

Rope

class

The document: a flat table of [[TextBlock]] leaves with indexes over chars, codepoints, paragraph separators, heights and line widths. Every position query — char↔codepoint, char↔paragraph, Y↔block, X↔block — is O(log blocks); an edit costs O(edited block) plus O(log blocks), or O(blocks) when it changes the block count. Blocks lent to workers through [[Lease]] are immutable for the lease's lifetime: an edit clones a shared block instead of mutating it.

57 members

Editing

Input behaviors, filters, validation and text documents

View all 77

Selection

Selection, caret, touch handles and context menus

View all 47

UniTextSelectable

class

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

47 members

TextCommand

class

A command of the text context menu: its label, when it applies, and what it does to the field that presents it. The field lists its commands in [[Commands]]; the system menu shows the applicable ones in that order, and the Unity-UI menu shows each on the item bound to it. Derive from it and implement [[Execute]] for a command of your own.

9 members11 derived

TextCommandSource

class

What a field's [[Commands]] list holds: a contributor of entries to the text context menu. A [[TextCommand]] contributes one entry; [[SystemTextActions]] the platform's own actions. Derive from [[TextCommand]] for a command of your own.

0 members3 derived

UniTextContextMenu

class

Context menu you lay out yourself in Unity UI: a panel and the objects its items show on, styled and localized however you like. Each of its [[Items]] binds an object of the layout to the command it runs; the menu shows the objects of the commands the field offers and runs a command when its object is clicked. It draws nothing itself, and one menu serves every field that presents it — a click acts on the field that showed it last.

4 members

ContextMenuItem

class

One item of a [[UniTextContextMenu]]: an object of the menu's layout and the command it runs. The menu shows the object while the field offers the command and runs the command when the object is clicked.

4 members

UniTextSelectionHandles

class

Shipped 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 the [[UniTextSelectable]] presenting them 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.

11 members

Interaction

Links, gestures, range actions and pointer-driven ranges

View all 37

Media

Inline sprites, objects and their providers

View all 25

Clipboard

Copy and paste adapters, clipboard formats and schemas

View all 18

Emoji

Color emoji fonts

View all 3

Platform

Native input, IME and clipboard backends

View all 23

Utilities

Attributes, Unicode data and helpers

View all 12