# Ink River

> Lines of type laid on curved paths, morphable to a plain reading column. A Catmull-Rom spline carries each line so text never falls off its path.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Interactive 3D](https://www.sandbase.ai/skills/interactive-3d)
- Version: 0.1.1
- Runs online: yes
- Page: https://www.sandbase.ai/skills/interactive-3d/ink-river

## What you get

Bring a text and the curve to lay it on. The Skill returns a downloadable Skill and a runnable type river.

## Install

Download the Skill package from https://www.sandbase.ai/skills/interactive-3d/ink-river (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/ink-river build a flowing-type editorial on <your text>
```

## How it works

1. **Pick the poem brief** Ink River sets a poem with every line on its own bend of a river. The poem lives in assets/briefs per locale. In the ink-river folder, npm run build writes dist/index.html from the English desk brief, and npm run build:zh uses the Chinese lamp brief. src/ink.js holds the path and curve math plus the Line and Poem classes, and src/index.template.html holds the stage and controls.
2. **Lay type on curves** Each line's path is a Catmull-Rom spline through authored control points, with a straight run-off along the last chord so a textPath never runs out. The shapes act out the words: meander, bends, a hook, level, rise, dip, fade and runout. Set it straight lerps every control point to a plain row, return it restores the bend, a held hand slows the drift and a drag pulls the water aside.
3. **Shoot in the sandbox** npm run shoot serves dist/ with all network blocked and asserts the mechanism's semantics, then open dist/index.html or use any static server. Text is measured live with getComputedTextLength, and widths come from a cached hidden 100 px sample rather than estimates. The verified build sets 8 lines across 5 folio pages. Check that the straight row reads as a plain column.

## FAQ

### Is Ink River real text?

Yes. Ink River lays real SVG text on textPath curves, so it stays selectable text rather than a texture. setReveal(n) splits each line into tspans for a visible prefix, a hidden tail and an optional red span, and re-splits whenever the count or the red range changes.

### What does Set it straight do in Ink River?

Ink River's Set it straight lerps every control point of each line to a horizontal row, while size, letter spacing, offset and alpha lerp to plain values. Return it lets each line find its bend again. Another control replays the write-in, which reveals characters per second, staggered by line.

### Does Ink River need a key?

No. Ink River needs no key and makes no network or runtime calls, so a build or a reading costs nothing. The shoot step blocks all network while it checks the page.

### What are the Ink River limits?

Ink River's morph is a control-point lerp, so mid-paths are smooth but do not preserve arclength. Reveal splitting works per character, not per glyph cluster. The text measurer needs SVG in the DOM and falls back to 0.55 times the length per em when it cannot measure.

### Can Ink River set a different poem?

Yes. Ink River reads its poem from the briefs in assets/briefs, one per locale, and both an English and a Chinese brief ship. Each line's path is authored to act out its words, so a new poem needs new control points as well as new text.

## Examples

- Ink River type folio (scene)
- The Ink River (video)
