Re: NSLayoutManager and widows and orphans
Re: NSLayoutManager and widows and orphans
- Subject: Re: NSLayoutManager and widows and orphans
- From: "Martin" <email@hidden>
- Date: Mon, 19 Mar 2007 17:12:33 -0700
> Does anybody have any idea how you might enhance TextEdit's MultiplePageView to
> handle widows and orphans?
Unfortunately there doesn't seem to be any particularly obvious or clean way of doing this with the text system. However, you can accomplish it- here's the general idea:
1. Wait for layout of a particular text container to finish.
2. Check for the situation where you have a widow or orphan.
3. Somehow take note of the location of this widow/orphan in your own layout information.
4. Invalidate the layout for the text that needs to be redone.
5. Have a subclass of NSTypesetter that can detect the scenario you recorded in step 3 above. As the relevant line fragment(s) is being set, reject the layout and advance to the
next text container. See this post by Aki:
http://www.cocoabuilder.com/archive/message/cocoa/2004/7/5/111040
It's all a bit tricky- good luck,
~Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden