<text>
Lay out editable Unicode copy as glyph geometry for a shape.
Examples
Download the complete .nothing source · Source on GitHub
Rendered with ncf-preview at 120 × 80.
Bound resources
- fixtures/fonts/PT_Serif/PTSerif-Regular.ttf for
PT Serif@400 - ncf/conformance/attached-drawables/arithmetic.ttf for
NCF Arithmetic@400

<shape>
<text x="4" y="24" font-family="NCF Arithmetic" font-size="20" inline-size="44" line-height="26">AA ЖЖ</text>
<fill><paint><solid color="#FFFFFFFF"/></paint></fill>
</shape>A text element owns paragraph settings and copy. It contributes glyph outlines to the owning shape. Direct copy and child spans join without extra separators.
Syntax
Keep a caption centered through a copy change
Set the line anchor to x = 160 and the first baseline to y = 128. With PT Serif Regular and Bold bound, seek to frame 24 for “Status WAIT.” Narrow the inline size to 90 and the lines center separately at baselines 128 and 158.
<text x="160" y="128" text-anchor="middle" font-family="PT Serif" font-size="24" inline-size="288" line-height="30">Status <span font-weight="700">READY<fill><paint><solid color="#2060E0FF">
<animate attributeName="color" fill="freeze">
<key frame="0" value="#2060E0FF" ease="linear"/>
<key frame="24" value="#60C080FF"/>
</animate>
</solid></paint></fill><animate attributeName="value" fill="freeze">
<key frame="0" value="READY" ease="hold"/>
<key frame="24" value="WAIT"/>
</animate></span>.</text>Complete .nothing source · Sample checks
Usage context
Allowed parents are <shape>.
Inherits from Geometry.
Includes Text copy.
Character data beside span or animation children, including indentation, is significant. Resolve font input and fallback before sampling geometry or paint.
Attributes
x
Value local units · If omitted 0 · Keys Scalar
Horizontal anchor for each line. Typeface and paragraph
y
Value local units · If omitted 0 · Keys Scalar
Vertical position of the first alphabetic baseline. Typeface and paragraph
font-family
Value One nonempty family name · Required · Keys Held
Requested family resolved in the sample's font environment. Authored font requests
font-size
Value local units · Required · Keys Scalar
Positive em size. Typeface and paragraph
font-weight
Value Exact integer from 1 to 1000 · If omitted 400 · Keys Held
Requested face weight. Authored font requests
text-anchor
Value start, middle, end · If omitted start · Keys Held
Align each line's advance at x. Start anchors the left edge in LTR and the right edge in RTL. End anchors the opposite edge. Middle anchors the midpoint. Typeface and paragraph
direction
Value ltr, rtl · If omitted ltr · Keys Held
Paragraph base direction for bidirectional layout. Typeface and paragraph
inline-size
Value local units · If omitted natural line width · Keys Scalar
Positive available width for soft wrapping. A track requires an authored finite width. Typeface and paragraph
line-height
Value local units · If omitted 1.2 times the sampled text font size · Keys Scalar
Positive distance between successive baselines. Typeface and paragraph
Animation-only targets
value
Value Literal Unicode character data · If omitted direct character data · Keys Held · Declared by Text copy
Replace the copy at the key's time. In an XML key value, write LF and tab as character references. A track requires an owner with no child spans. The base is the concatenated direct character data after XML processing.
Children
| Elements | Cardinality | Declared by | Role and source order |
|---|---|---|---|
<span> | Zero or more | <text> | Editable copy ranges that can supply a local style. Document order interleaved with literal character data. |
<animate> | Zero or more | Animation | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. Evaluating animation tracks |