• 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: width of NSString in pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: width of NSString in pixels


  • Subject: Re: width of NSString in pixels
  • From: Eric Peyton <email@hidden>
  • Date: Tue, 27 Nov 2001 09:15:08 -0600

No, that will only return the length of the string in characters ...

What you want is in NSStringDrawing.h in AppKit

@interface NSString(NSStringDrawing)

- (NSSize)sizeWithAttributes:(NSDictionary *)attrs;

@end

From the correct attributes you should be able to determine how big (high and wide) the string is.

Eric

On Tuesday, November 27, 2001, at 08:39 AM, John Nestor wrote:

[string length] I believe

On Tuesday, November 27, 2001, at 07:27 AM, Robert Miller wrote:

Hello,

Can someone tell me how to determine the width of an NSString in
pixels using Cocoa? I can only find this functionality in the Carbon API
using the Appearance Mgr. ? Am I missing something ?

Thanks in advance,
Regards,
Bob M.
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: width of NSString in pixels (From: John Nestor <email@hidden>)

  • Prev by Date: Re: width of NSString in pixels
  • Next by Date: Re: width of NSString in pixels
  • Previous by thread: Re: width of NSString in pixels
  • Next by thread: Re: width of NSString in pixels
  • Index(es):
    • Date
    • Thread