Skip to content

feat(text): carry typography controls on the constraint wire (11.14 layer 1) - #67

Open
thejustinwalsh wants to merge 2 commits into
refactor/policy-dslfrom
feat/typography-wire
Open

feat(text): carry typography controls on the constraint wire (11.14 layer 1)#67
thejustinwalsh wants to merge 2 commits into
refactor/policy-dslfrom
feat/typography-wire

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

What

Layer 1 of the 11.14 typography tier: the wire contract. Constraint records grow 56 → 84 bytes carrying the professional typography controls — none of them steer layout yet.

Field Meaning
firstLineIndent extra inline offset for the paragraph's first line
spaceBefore / spaceAfter block-axis paragraph spacing
justifyMinWordSpaceRatio word-space shrink floor, in (0, 1]; 0 = no shrink
justifyMaxWordSpaceRatio word-space expansion cap, ≥ 1; 0 = unbounded
justifyLetterSpaceExpansion per-gap letter-space budget once spaces cap out
lastLine closed enum: auto (current behavior) or justify

Contract properties

  • Zero-filled ratio/indent/spacing fields reproduce the pre-tier behavior exactly; lastLine is strictly validated (auto/justify, no open values).
  • Rust decodes, range-validates, and retains the fields; the raw-byte geometry fingerprint already covers them, so any change invalidates flow automatically.
  • The generated TS ABI, frame-wire encoder (optional inputs with zero defaults), record-size pins, and test request builders move in the same commit — the CI ABI drift gate stays meaningful.

Evidence

Rust: 173 lib tests including a new bounds test (accepts a full typography record; rejects negative indent/spacing, out-of-range ratios, NaN, and open last-line values). TS: a new frame-wire test decodes the compiled record at the generated offsets for both explicit values and defaults. Full package check green.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
Core JS (gzip) 18.47 KB (+0.49% 🔺)
Shaper Wasm (gzip) 418.57 KB (-0.05% 🔽)
Three.js adapter JS (gzip) 60.29 KB (+0.34% 🔺)
Inter font · Bitmap (gzip) 545.27 KB (0%)
Inter font · MTSDF (gzip) 6.48 MB (0%)
Inter font · Slug (gzip) 604.06 KB (0%)
Font Awesome icons · Bitmap (gzip) 439.53 KB (0%)
Font Awesome icons · MTSDF (gzip) 6.89 MB (0%)
Font Awesome icons · Slug (gzip) 642.64 KB (0%)
Font validator JS (gzip) 134.24 KB (0%)
Runtime bake host JS (gzip) 5.38 KB (0%)
Runtime bake Worker JS (gzip) 142.45 KB (0%)
Font baker JS (gzip) 2.41 KB (0%)
Font baker Wasm (gzip) 379.63 KB (0%)
Bitmap baker JS (gzip) 4.66 KB (0%)
Bitmap baker Wasm (gzip) 228.31 KB (0%)
MTSDF baker JS (gzip) 5.39 KB (0%)
MTSDF baker Wasm (gzip) 209.22 KB (0%)
Slug baker JS (gzip) 4.01 KB (0%)
Slug baker Wasm (gzip) 181.24 KB (0%)

…ayer 1)

Constraint records grow 56 -> 84 bytes: first-line indent, paragraph
space before/after, independent word-space ratio bounds (zero means
unbounded on that side), a letter-space expansion budget, and a closed
last-line policy enum. Rust decodes, validates, and retains the fields;
the raw-byte geometry fingerprint already invalidates on any change.
The generated ABI, TS frame-wire encoder with zero defaults, record
size pins, and test request builders move together. No layout behavior
changes in this layer.
@thejustinwalsh
thejustinwalsh marked this pull request as ready for review August 14, 2026 02:31
# Conflicts:
#	apps/benchmarks/src/generated/package-sizes.json
#	docs/packages/benchmarks.md
#	docs/packages/glyph.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant