• 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: Calculating the size of NSFont...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating the size of NSFont...


  • Subject: Re: Calculating the size of NSFont...
  • From: m <email@hidden>
  • Date: Sun, 4 Mar 2007 10:14:26 -0600


On Mar 4, 2007, at 12:52 AM, Rachel Blackman wrote:

Alright, one more query, as long as I'm diving back into the cocoadev folder... :)

I've got a monospaced font. I need to calculate the 'width' of a given character, so that I can figure out certain things.

Not knowing what "certain things" need figuring out, I wonder if instead you might be able to exploit NSStrings sizeWithAttributes: method. sizeWithAttributes "returns the bounding box size the receiver occupies when drawn with the given attributes."


You can pass it a dictionary to specify the font and figure out the size a string will be drawn.

_murat
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Calculating the size of NSFont... (From: Rachel Blackman <email@hidden>)

  • Prev by Date: Re: rotating an object around the center of a view
  • Next by Date: Re: QuartzCore.h not being recognized
  • Previous by thread: Re: Calculating the size of NSFont...
  • Next by thread: Re:Calculating the size of NSFont...
  • Index(es):
    • Date
    • Thread