Re: Part of an NSAttributedString that fir a rectangle ?
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