mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-26 10:05:36 +00:00
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.
Requires objj be installed, as well as ojunit, located at http://github.com/cappuccino/ojunit
Run individual tests using a command similar to the following:
objj ojunit/OJTestRunnerText.j cappuccino/Tests/Foundation/CPDateTest.j