On Oct 30, 2009, at 10:10 AM, Chunk 1978 wrote:

does sizeWithAttributes not take into account the offset of an NSDropShadow or italic font mask? i have a dictionary of attributes for a string, and i'm trying to produce an image for the drag that doesn't crop the image with
these attributes.


It doesn't consider the shadow metrics.  I filed this in 2004:

<rdar://3910767> "Cocoa string drawing doesn't take shadow metrics in account"

The workaround is to use the shadow metrics and modify the size value. I do the following myself:

width modified by (shadow x offset plus blur radius)
height modified by (shadow y offset plus blur radius)

I believe the Italic issue also needs a workaround (search this list archives because that has come up before)

___________________________________________________________
Ricky A. Sharp         mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to