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

Part of an NSAttributedString that fir a rectangle ?


  • Subject: Part of an NSAttributedString that fir a rectangle ?
  • From: Eric Morand <email@hidden>
  • Date: Sun, 7 Aug 2005 16:13:35 +0200

Hi list ?


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 ?





Just in case, I need this because I'd like to create a control that can wrap a long string into multiple lines and then truncate the tail of the string with an ellipsis when the number of lines is equal to a limit I'll fix.



For example, I want a control that would present the string "Can someone help me on this ? I can't figure how to achieve this !" like this, if I set the max number of lines to 2 :




Can someone help me
on this ? I can't figure...



To summarize : I wan't to be able to draw text just like the RSS articles are presented in Safari !







Thanks by advance,


Eric.

_______________________________________________
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 fir a rectangle ?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Codec type from QTMovie/QTMedia/QTTrack
  • Next by Date: Re: Part of an NSAttributedString that fir a rectangle ?
  • Previous by thread: Re: Codec type from QTMovie/QTMedia/QTTrack
  • Next by thread: Re: Part of an NSAttributedString that fir a rectangle ?
  • Index(es):
    • Date
    • Thread