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 00:08:49 -0500
Oh, nice lead! Thanks. I hadn't come across that class yet. I will
poke around.
Daniel
On Feb 17, 2008, at 10:05 PM, Ben Lachman wrote:
You might want to look into NSTextBlock. I believe they are tied to
one text container at a time and therefore move to the next
container as a block instead of line by line. You access the text
block through NSMutableParagraphStyle's setTextBlocks: method. You
could also look into the NSTextTable class which uses a sub-class of
NSTextBlock for its cells. I haven't done this myself though, so I
could very well be wrong on this one.
->Ben
--
Ben Lachman
Acacia Tree Software
http://acaciatreesoftware.com
email@hidden
740.590.0009
On Feb 17, 2008, at 8:03 PM, Daniel Jalkut wrote:
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?
_______________________________________________
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