Re: Where to enforce paragraph-cohesion policy in text system?
Re: Where to enforce paragraph-cohesion policy in text system?
- Subject: Re: Where to enforce paragraph-cohesion policy in text system?
- From: Daniel Jalkut <email@hidden>
- Date: Mon, 18 Feb 2008 16:40:58 -0500
Thanks, Douglas. Really appreciate your input.
On Feb 18, 2008, at 1:55 PM, Douglas Davidson wrote:
NSTypesetter would be the appropriate place for this sort of policy,
since it is responsible for actually laying out the lines of text.
Bear in mind, though, that the typesetter won't know that a
paragraph doesn't fit until it has laid out some of the lines and
discovered that it has run out of space before the end of the
paragraph. NSTypesetter gets called to layout a paragraph at once,
and then queries the text container for each individual line;
probably what you would need to do would be to subclass NSTypesetter
and at some point detect that condition, then set some flag
indicating that the paragraph should be moved to the next container,
and restart layout from the beginning of the paragraph. I'm not
sure offhand exactly where the right override points in NSTypesetter
would be.
The suggestion of using tables/blocks is also a reasonable one, but
it's not a complete solution to the keep-together issue because the
editing behavior of table cells/blocks is somewhat different from
that of ordinary paragraphs. If you're dealing with non-editable
text this might be a good solution, but for freely editable text I
would tend to look at a typesetter-based solution.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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