• 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
Re: how to measure an attributedString or string with attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >how to measure an attributedString or string with attributes (From: norio <email@hidden>)

  • Prev by Date: Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?
  • Next by Date: Re: Hillegass, Third Edition, Chapter 18
  • Previous by thread: how to measure an attributedString or string with attributes
  • Next by thread: Re: how to measure an attributedString or string with attributes
  • Index(es):
    • Date
    • Thread