Skip navigation.
 
mlRe: Where to enforce paragraph-cohesion policy in text system?
FROM : Daniel Jalkut
DATE : Mon Feb 18 22:40:58 2008

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.

Related mailsAuthorDate
mlWhere to enforce paragraph-cohesion policy in text system? Daniel Jalkut Feb 18, 02:03
mlRe: Where to enforce paragraph-cohesion policy in text system? Ben Lachman Feb 18, 04:05
mlRe: Where to enforce paragraph-cohesion policy in text system? Daniel Jalkut Feb 18, 06:08
mlRe: Where to enforce paragraph-cohesion policy in text system? Douglas Davidson Feb 18, 19:55
mlRe: Where to enforce paragraph-cohesion policy in text system? Daniel Jalkut Feb 18, 22:40