Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
- Subject: Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 9 Jul 2008 01:16:46 +0200
On Jul 9, 2008, at 12:53 AM, Douglas Davidson wrote:
On Jul 8, 2008, at 3:44 PM, Stéphane Sudre wrote:
What I mean by incorrect value is that if I draw the string inside
a rectangle whose width is inMaxWidth and height is the value
obtained from the rect returned by usedRectForTextContainer:, the
last line of the string is clipped outside the rectangle. And the
difference increases with the number of lines.
Most likely you are dealing with a mismatch between the way you are
measuring and the way you are drawing, probably a difference in the
typesetterBehavior. Typesetter behavior issues have been discussed
on the lists a number of times; try searching the archives.
I was going to write that using [myUncooperatingLayoutManager
setTypesetterBehavior:NSTypesetterBehavior_10_2_WithCompatibility];
didn't change anything but apparently, you have to call it before
glyphRangeForTextContainer:.
It could be worth a Technote or a QA on the ADC website IMHO (if
these things still exist).
Thanks a lot.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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