bonaldi
2010-02-17 20:34:54
A:
A:
You might be interested in Jerry Krinock's great NS(Attributed)String+Geometrics
category, which is designed to do all sorts of string measurement, including what you're looking for.
Rob Keniger
2010-02-18 00:17:33
+1
A:
-[NSAttributedString boundingRectWithSize:options:].
You can specify NSStringDrawingUsesDeviceMetrics to get union of all glyph bounds
http://lists.apple.com/archives/Cocoa-dev/2006/Feb/msg00564.html
Unlike -[NSAttributedString size] the returned NSRect represents the dimensions of the area that would change if the string is drawn.
Graham Miln
2010-03-17 05:33:48