• 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: dynamically sized text container
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamically sized text container


  • Subject: Re: dynamically sized text container
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 12 Jun 2007 10:05:42 -0700


On Jun 12, 2007, at 9:56 AM, LAURENS Jérôme wrote:

This question concerns the cocoa text system.
Actually, the text system fills text containers according to their size.
How can I inform the text system that a text container is full when its last word is for example "STOP".

The easiest thing would be to introduce a page break (NSFormFeedCharacter, 0xc) after the last line you want in the container.


If you need to do this completely dynamically, then it would probably be done at the NSTypesetter level. For example, you could use a custom typesetter subclass, override - actionForControlCharacterAtIndex:, and return NSTypesetterContainerBreakAction after the last line you want in the container. Alternatively you could work with one of the line fragment rect methods.

Douglas Davidson

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >dynamically sized text container (From: LAURENS Jérôme <email@hidden>)

  • Prev by Date: dynamically sized text container
  • Next by Date: RE: Error and Exception Handling: When to use
  • Previous by thread: dynamically sized text container
  • Next by thread: performance of encoding an array of structs
  • Index(es):
    • Date
    • Thread