• 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: Part of an NSAttributedString that fir a rectangle ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Part of an NSAttributedString that fir a rectangle ?


  • Subject: Re: Part of an NSAttributedString that fir a rectangle ?
  • From: Ricky Sharp <email@hidden>
  • Date: Sun, 7 Aug 2005 09:39:24 -0500


On Aug 7, 2005, at 9:13 AM, Eric Morand wrote:

Is there a way to know what part of an attributed string fit in a rectangle, taking the line breaking mode into account ?


For example, let's say I have an attributed string whose string is "Hello COCOA-DEV List !" and whose line breaking mode is NSLineBreakByWordWrapping. And let's say that I have a rectangle that is too narrow to fit the entire string and that will only be able to contain "Hello COCOA-DEV" when the attributed string is drawn inside. How can I know programatically that the word "List" has been truncated ?

Take a look at:

<http://developer.apple.com/samplecode/TipWrapper/TipWrapper.html>

Specifically look at the NSTextView_Lines.h/.m. It provides a category on NSTextView where you can obtain a line count. You may have to modify the code to work with specified wrapping modes and widths of your controls.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Part of an NSAttributedString that fit a rectangle ?
      • From: Eric Morand <email@hidden>
References: 
 >Part of an NSAttributedString that fir a rectangle ? (From: Eric Morand <email@hidden>)

  • Prev by Date: Part of an NSAttributedString that fir a rectangle ?
  • Next by Date: NSBrowser & Binding
  • Previous by thread: Part of an NSAttributedString that fir a rectangle ?
  • Next by thread: Re: Part of an NSAttributedString that fit a rectangle ?
  • Index(es):
    • Date
    • Thread