• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Where to enforce paragraph-cohesion policy in text system?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where to enforce paragraph-cohesion policy in text system?


  • Subject: Re: Where to enforce paragraph-cohesion policy in text system?
  • From: Ben Lachman <email@hidden>
  • Date: Sun, 17 Feb 2008 22:05:20 -0500

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, b ut 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


  • Follow-Ups:
    • Re: Where to enforce paragraph-cohesion policy in text system?
      • From: Daniel Jalkut <email@hidden>
References: 
 >Where to enforce paragraph-cohesion policy in text system? (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Setting NSTextField inside drawRect:
  • Next by Date: Re: A couple questions relevant to games
  • Previous by thread: Where to enforce paragraph-cohesion policy in text system?
  • Next by thread: Re: Where to enforce paragraph-cohesion policy in text system?
  • Index(es):
    • Date
    • Thread