Where to enforce paragraph-cohesion policy in text system?
Where to enforce paragraph-cohesion policy in text system?
- Subject: Where to enforce paragraph-cohesion policy in text system?
- From: Daniel Jalkut <email@hidden>
- Date: Sun, 17 Feb 2008 20:03:35 -0500
My goal is to impose a policy in my series of text containers, such
that a paragraph is never split across two containers. Because I have
very small paragarphs (clues of a crossword puzzle), it makes sense to
leave a blank space at the bottom of one container (a column) than it
does to break the paragraph across two columns.
I'm trying to figure out the most appropriate place to impose this
kind of policy. I'm intrigued by NSTypesetter because it seems to be
where the action of determining line fragment rectangles happens.
Should I be subclassing NSTypesetter and somehow causing it to avoid
seeking to fill a container with line fragments, if it won't succeed
in filling an entire paragraph?
I'm a little intrigued by NSLayoutManager's
textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout,
but I suspect I won't really know until it's too late that a paragraph
didn't fit in the container. By then it seems complicated to undo the
previously laid out line fragments.
Is it possible I'm overlooking an easy solution to this problem? If
not, what would be a good strategy to implement my own general solution?
Daniel
_______________________________________________
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