On Sep 6, 2009, at 2:03 AM, Dave Keck wrote:

I've noticed this too. If you need the absolute precise pixel-size of
some text, then the only way I know of (that works with all different
styles of text) is manually drawing the text into some temporary
context, and analyzing its pixels.

-[NSString boundingRectWithSize:...] might do this, especially with the NSStringDrawingUsesDeviceMetrics flag ("Uses image glyph bounds instead of typographic bounds").

Failing that, you ought to be able to use NSLayoutManager to compute the bounding box of all the glyphs, but I don't know how.

—Jens

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to