Re: NSString width
Re: NSString width
- Subject: Re: NSString width
- From: Dave Keck <email@hidden>
- Date: Sun, 6 Sep 2009 10:04:31 -1000
> -[NSString boundingRectWithSize:...] might do this, especially with the
> NSStringDrawingUsesDeviceMetrics flag ("Uses image glyph bounds instead of
> typographic bounds").
Indeed. When I tried that method in the past, I got it working
half-way with italicized text (the width was correct, but the height
wasn't.) I ended up having to do more math on top of
-boundingRectWithSize: based on the font's descender. Eventually it
worked for my specific case, but I doubt my technique works in every
scenario.
I'll keep NSLayoutManager in mind for the future...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden