TextEdit on Big Sur does not use TextKit 2 for "Wrap to Page." As noted above by the Frameworks Engineer, the functionality is not available in TextKit 2.
Post
Replies
Boosts
Views
Activity
Is there any additional information on this? Monterey is now RC and FB9285387 is still open with no similar reports. The lack of this feature would cripple my app, which has been on Mac since 2007. I think many developers would appreciate guidance here, even if it's just a commitment on how long Apple will maintain TextKit 1.
Feedback submitted as FB9285387: TextKit 2 missing support for page-based layout
TextKit 2 was introduced at WWDC21 as "Apple's next-generation text engine" that has been in use on macOS since Big Sur. The new engine looks promising, but unfortunately, it is missing support for page-based layout. This is a critical feature, the omission of which will adversely affect a wide range of applications.
In the "old" TextKit, page-based layout is accomplished by providing an array of NSTextContainers to NSLayoutManager, each with its own NSTextView. The process is described in Using Text Kit to Draw and Manage Text and in the widely distributed sample code for TextEdit.
In TextKit 2, NSTextLayoutManager allows only a single NSTextContainer, making it impossible to support more than one page of text.
To achieve better feature parity with the "old" TextKit, TextKit 2 should be enhanced to support page-based layout.