mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
Adds TextShape::Area { path } and lays it out: each paragraph is broken
a line at a time with parley's BreakLines, because a line's width
depends on where it lands in the shape (the row's spans at that
baseline), which break_all_lines can't express. Rows are planned with
the first style's metrics and re-planned once with the real ones when a
line is taller, so mixed sizes can leave a little extra gap. Lines align
within their own span (parley aligns per line to the width it was broken
at; no manual alignment needed). Text past the shape is hidden, as in a
text box, and hides later paragraphs too.
A span too narrow for the word that would start it (the narrow top of an
ellipse) is left empty and the word moves on, so lines stay inside the
shape; a word wider than the whole shape overflows its span, as in a box.
BreakLines doesn't report trailing whitespace, so this is checked after
each pass and the paragraph re-broken (at most 64 skips).
PSD has no area type writer yet: an area layer saves as paragraph text
over the path's bounds, so Photoshop opens it wrapping in a rectangle.
Other matches (PSD import, transform box, point/box conversions) get the
arm matching their neighbours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>