Re: Calculating the size of NSFont...
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