Nothing

Keep text editable

Style literal copy, replace a word at a key, or reproduce wrapped layout with a fixed font environment.

Read as Markdown

Use text as a shape’s geometry to keep the copy and paragraph settings editable. The text owns its first baseline y, its horizontal anchor x, and its base font family and size. Use the shape’s fill for the base ink. Put a span around a range that needs its own style or fill. Whitespace between spans is literal copy, so indent mixed content only when the added spaces and line breaks belong in the text. Text content and paragraph fields

Replace one word at a key

In the moving-card scene, the line starts with the literal copy Status READY. and the status word belongs to a bold span. That span has a held animate attributeName="value" track. The period and preceding text remain part of the surrounding text. At frame 24 the span reads WAIT and its separate color track gives it a green fill. Change the frame-24 key’s value to DONE to edit that sampled word. Change the span’s character data to edit its base copy. Each edit targets a different source location.

Place replacement keys on a text or span without nested spans. The string target is spelled value inside attributeName; the key’s value attribute holds the replacement copy. For a literal newline in a key value, use 
. Copy ownership and replacement · Source edits

Wrap and reproduce a layout

The caption scene requests NCF Arithmetic at size 20. Its two A glyphs advance 24 units. The face lacks Cyrillic, so the two Ж glyphs use PT Serif and advance about 37.88 units. With inline-size="44" the words fall on separate lines at baselines 24 and 50. With inline-size="74" both words fit on the first line: 24 units for the first word, 12 for the space, and about 37.88 for the second word.

Bind both exact faces and hide installed fonts to reproduce that result. The name in the scene expresses a family request. The command supplies the actual font files. Run from the repository root after setting up the shared fixtures.

(cd ncf && cargo run --locked -p ncf-preview -- \
  conformance/fonts/caption.nothing --fonts-only \
  --font 'NCF Arithmetic@400=conformance/attached-drawables/arithmetic.ttf' \
  --font 'PT Serif@400=../fixtures/fonts/PT_Serif/PTSerif-Regular.ttf' -o ../caption.svg)

When a family is missing, a host can report the request and substitute an available face. The original request stays in the file. The available faces, fallback order and shaping environment can change wrapping and ink. Share those inputs with the scene when the layout must repeat. Font resolution · Independent glyph and baseline observations

Examples

Download the complete .nothing source · Source on GitHub

Rendered with ncf-preview at 120 × 80.

Bound resources

The two square primary glyphs share the first baseline. The two Cyrillic characters use the fallback face and wrap to the second baseline.
Still · Wrapped caption at 0sThe two square primary glyphs share the first baseline. The two Cyrillic characters use the fallback face and wrap to the second baseline.
XML source
  <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>

On this page