Re: how to measure an attributedString or string with attributes
Re: how to measure an attributedString or string with attributes
- Subject: Re: how to measure an attributedString or string with attributes
- From: Phil <email@hidden>
- Date: Thu, 17 Jul 2008 00:47:12 +1200
On Thu, Jul 17, 2008 at 12:18 AM, norio <email@hidden> wrote:
> I think QuickTime API had an api for measuring the width and the height of
> an attributed string.
> If width was passed as an argument, the height was returned. And if height,
> returned its width.
>
> Is there any ways to get such information?
>
For an NSString with attributes dictionary, AppKit has a category with
some methods that sound like what you want:
<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSString_AppKitAdditions/>
For an NSAttributedString there are a couple of methods in its AppKit
category too:
<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/>
(Namely, -size and -boundingRectWithSize:options:)
Phil
_______________________________________________
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