Re: Height of an NSAttributedString
Re: Height of an NSAttributedString
- Subject: Re: Height of an NSAttributedString
- From: Philip Dow <email@hidden>
- Date: Wed, 21 Dec 2005 18:44:58 +0100
Hi Doug,
boundingRectWithSize:options: is poorly documented, doesn't seem to
work and is not 10.3 compatible. =(
I have tried both methods, a text view to do the measuring as well as
the three text objects connected to one another. Both produce the
exact same results.
By results, I mean, giving the text I am using, Lucida Grande as the
only font results in an incorrectly calculated height, as do most
other fonts, while Times New Roman does not. Adding or removing
graphics does not seem to have any effect on the calculation, but
chancing the line height multiple does, resulting in an incorrect
height for Times New Roman as well.
I'm just about finished with an example project. I'll post it here in
a jiff.
-Phil
On Dec 21, 2005, at 6:34 PM, Douglas Davidson wrote:
You should now be able to use -[NSString
boundingRectWithSize:options:attributes:] or -[NSAttributedString
boundingRectWithSize:options:]. Alternatively, you can certainly
use a text view to do the measuring for you, or for the most
control, set up a text storage, text container, and layout manager
yourself.
I'm not sure exactly what you mean when you say that you are not
getting accurate results; perhaps you could produce and post a
simple example, showing the results you expect and the results you
actually see.
Douglas Davidson
_______________________________________________
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