Port behavior and regression coverage into current modules; preserve current upstream behavior.
Ported hanging punctuation into current line placement and kerning modules, preserving forced breaks, bounded edge-tip row merging, justified-last-line behavior, area exclusions and independent Roman orientation shaping; kept PSD/engine/UI regression coverage.
Vertical type laid Latin letters and digits on their side (the word
turned 90°), and called that Photoshop's default. Photoshop's Vertical
Type tool stacks them upright, one character per em down the column:
the run's BaselineDirection is 1 (withStream); 2 (rotated) turns them.
- doc: CharStyle::rotate_roman (false = upright, the default).
- text/psd: BaselineDirection is read (a run without one takes the
style sheet's, which Photoshop writes as 2) and written back.
- text/layout: in vertical type, roman characters take the upright
path unless their run rotates them. Each is given one em down the
column (a second shaping pass sets its letter spacing from the shaped
advance), with pair kerning off between the stacked letters.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Integration: resolve with main for area type (#6230)
- Image Size with a new resolution (#7124, canvas_geom::set_resolution) now scales an area type's
path with the text space like a box or a type path, so the same words wrap onto the same lines;
test a_resolution_change_keeps_area_type_wrapping_where_it_was fails without it.
- The Paragraph panel's justify buttons (#7713) stay available on area type, which is paragraph
text in Photoshop; test justify_buttons_work_on_area_type.
- Test files: main's tests plus #6230's; layout.rs imports joined; docs and scorecard regenerated.
Photoshop's Paragraph panel checkbox, per paragraph style:
- doc: ParagraphStyle.hanging (serde default off; .pcraft keeps it).
- layout: a trailing run of closing marks (. , : ; ! ? and fullwidth
twins, ellipsis) trims out of the aligned width on center/right lines,
so a centered line ending in an ellipsis stays centered; a wrapped row
of nothing but marks steps back onto the line above and hangs past the
box edge (contiguous ranges, merged-row baseline, manual kerning; no
RTL, vertical or tabs).
- PSD: /Hanging bool in the paragraph sheet, right after /LeadingType as
the corpus files show; read defaults off.
- engine: type.setStyle takes "hanging":bool, params doc updated.
- UI: checkbox in the Paragraph section, a Paragraph Styles editor row,
Character dock group grows one row; translations for the new label.
- tests: layout hang runs (trim, merge-back, plain no-op), PSD write and
paragraph-sheet read round trips, engine setStyle, panel harness.
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 <[email protected]>
CharStyle had no superscript/subscript attribute, so PSD import ignored FontBaseline and the first re-render (entering text editing) drew the run as plain text. Model it as CharStyle::baseline, read and write FontBaseline in EngineData, draw such runs at 58.3% of their size shifted by 33.3% of it (Photoshop defaults), and accept "baseline" in the character params.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Type: type on a path, glyphs follow the curve (#4365)
Add TextShape::Path (path, start offset, flip). The text is laid out as one
point-text line and each glyph is placed rigidly on the flattened path by arc
length, turned to the tangent at its centre; glyphs past the end are hidden and
a degenerate path falls back to straight text. New commands type.attachToPath
(work path or shape layer subpath) and type.detachFromPath. TextShape is no
longer Copy. .pcraft round-trips the new variant.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Automation policy: type.attachToPath/detachFromPath take document vector paths, not host files (#4365)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: regenerate scorecard after merging main
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Brandon Thomas <[email protected]>
CI's `cargo fmt --all -- --check` has failed on every run because the
repo had no rustfmt config and was never formatted. Use the same settings
as EffectCraft/FilmCraft (max_width 160, use_small_heuristics Max), which
also keeps the churn small. Formatting only; no code changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>