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.