Files
cappuccino/Tests/Manual/TextEditor
David Richardson bb1cd85466 AppKit: Add justified text alignment to CPTypesetter
CPTypesetter lacked handling for CPJustifiedTextAlignment, causing justified paragraphs to fall back to left alignment. Additionally, centred and  right-aligned text improperly spanned the full container width by ignoring  paragraph indents, and trailing spaces on wrapped lines incorrectly shifted  line positioning.

* AppKit/CPTextView/CPTypesetter.j:
  - Implement CPJustifiedTextAlignment layout by distributing spare width  evenly across line spaces.
  - Preserve left alignment for paragraph final lines and segments preceding a tab, matching Cocoa behavior.
  - Constrain centred, right-aligned, and justified lines between head and tail indents.
  - Exclude trailing spaces from visible line width to allow proper hanging alignment.

* AppKit/CPTextView/CPLayoutManager.j:
  - Update _CPLineFragment to record extra space widths and render spans with matching CSS word-spacing.
  - Ensure fragment equality checks account for word-spacing variations.

* Tests/Manual/TextEditor/WORKLIST.md:
  - Mark justified and centred text layout tests as completed.

Centred and justified paragraphs now conform to standard Cocoa layout behavior.
2026-10-24 10:17:42 -06:00
..