A version 2 `text` element is now drawn. It replaces the placeholder that
parsed and placed a text and refused it as RENDERER_TOO_OLD.
What a scene can say
- `font` names one of the five bundled faces (or comes from `defaults`); any
other name is FONT_UNKNOWN. There is no printer font and no installed font.
- `size` is the em as a physical length (1 pt to 1000 pt), not rounded to dots.
- `value` or `valuePath`; `align`/`valign` place the block in the box and each
line in the block; `lineHeight`, `rotation`, `reverse`, `threshold`.
- `fit`: one line by default, shrunk in quarter-point steps to 70% of the size
(not below 5 pt), then refused. Opt in to more lines (`maxLines`) and to
cutting with an ellipsis (`overflow: truncate`).
- `maxLength`: validation proves the longest value fits, so a length refusal
happens when a scene is published; printing refuses a longer value first.
How it is measured and drawn
- Measurement is integer arithmetic on the face's own numbers (thousandths of
the em, read once at a reference size), so it is the same on every machine.
Every character sits at a whole-dot pen position and is drawn there by the
Java rasteriser that version 1 raster text uses, then reduced to ink at the
threshold. A line's box is its advance widened to its ink plus two dots a
side; a render whose ink would leave it fails instead of clipping.
- At each size a line is broken between words while that fits and at any
character when it does not, which is also what makes a length provable.
- One glyph for each character, left to right: no kerning, ligatures, mark
placement or bidirectional text. A character that cannot be drawn that way
is FONT_MISSING_GLYPH with a count.
Diagnostics (ids and numbers only; no value ever enters one)
TEXT_DOES_NOT_FIT, VALUE_MISSING, VALUE_TOO_LONG, FONT_UNKNOWN,
FONT_MISSING_GLYPH, RESERVED_FONT_NAME; TEXT_TRUNCATED, TEXT_SMALL_FOR_DPI,
TEXT_LIGHT_FACE, FIT_NOT_PROVEN; TEXT_SHRUNK, TEXT_WRAPPED.
Core seams added: `ElementSource.inherit` gives an element the scene's
`defaults` for the properties its type reads, and `ElementSource.refuse`
raises a coded refusal at a property (FONT_UNKNOWN at the place that names
the face, in the element, the defaults or an override).
Tests: goldens for the five faces and for fit, rotation and reverse at 203,
300 and 600 dpi, generated in the CI image (Linux, Temurin 21.0.9) and the
same bytes on Windows (21.0.12) and on Linux Temurin 21.0.13; every character
of every face drawn inside its measured line; seeded property tests of fit
(never shrunk when it fits, the largest size that fits, never below the floor,
never more lines than allowed, cut only when asked and always with the mark,
a proven length never refused); licence, provenance and hash of every face;
the version 2 mutation campaign extended to text. The version 1 corpus is
untouched. 100% line coverage of the scene 2 packages.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>