Skip to content

feat(text): apply paragraph spacing and first-line indent (11.14 layer 2) - #68

Open
thejustinwalsh wants to merge 1 commit into
feat/typography-wirefrom
feat/paragraph-spacing-indent
Open

feat(text): apply paragraph spacing and first-line indent (11.14 layer 2)#68
thejustinwalsh wants to merge 1 commit into
feat/typography-wirefrom
feat/paragraph-spacing-indent

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

What

Layer 2 of the 11.14 typography tier: spaceBefore, spaceAfter, and firstLineIndent begin steering layout, and the public Text gains wordSpacing style plus the contentBox typography fields.

Semantics

  • spaceBefore shifts a thread's first band exactly once, where the paragraph truly starts. Resumed threads (resumeCluster/resumeRegion nonzero) and region breaks swallow it — standard fragmentation behavior.
  • spaceAfter rides every block measurement, so consumers stack paragraphs from reported extents. It participates in at-most axis resolution and overflow detection.
  • firstLineIndent narrows the paragraph's first composed line (the break decision sees the reduced width) and shifts the pen on the paragraph-direction side: LTR pens move right; RTL pens keep their origin while the reduced available width pulls the right edge inward. Alignment and justification compose over the reduced slot unchanged. Measurements include the indent in first-line inline extents, and the intrinsic pass reuses the same constraint-carried values.

Evidence

Red-green at three levels: flow-composition unit tests (band shift, resume immunity, first-line break narrowing), a measurement unit test (indent in inline extent, space-after in block extent), and a Three integration segment pinning the exact 30-unit pen shift, 8-unit baseline shift, and content extents through the real Wasm engine. 176 Rust lib tests; full package check green.

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
Core JS (gzip) 18.46 KB (0%)
Shaper Wasm (gzip) 418.99 KB (+0.11% 🔺)
Three.js adapter JS (gzip) 60.37 KB (+0.16% 🔺)
Inter font · Bitmap (gzip) 545.26 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.3 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%)

…r 2)

spaceBefore shifts a thread's first band exactly once where the
paragraph truly starts; resumed threads and region breaks swallow it.
spaceAfter rides every block measurement so consumers stack paragraphs
from reported extents. firstLineIndent narrows the paragraph's first
composed line and shifts the pen on the paragraph-direction side: LTR
pens move right, RTL pens keep their origin while the reduced available
width pulls the right edge inward, so alignment and justification
compose over the reduced slot unchanged. Measurements mirror both, the
intrinsic pass reuses the constraint-carried values, and the public
Text gains wordSpacing style plus the contentBox typography fields.
Proven red-green at flow-composition, measurement, and Three
integration levels.
@thejustinwalsh
thejustinwalsh force-pushed the feat/paragraph-spacing-indent branch from d95ab8e to fd0dac5 Compare August 12, 2026 06:00
@thejustinwalsh
thejustinwalsh marked this pull request as ready for review August 14, 2026 02:32
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