NSString -drawWithRect:options:attributes
NSString -drawWithRect:options:attributes
- Subject: NSString -drawWithRect:options:attributes
- From: Steve Cronin <email@hidden>
- Date: Thu, 16 Aug 2007 02:39:30 -0500
Folks;
I'm trying to draw text into a view:
[myImageTitleString drawWithRect:titleRect
options:NSStringDrawingUsesLineFragmentOrigin
attributes:labelAttributes];
Some of the time its fine - some of the time its not.
It seems to depend on the NSFont declared in the NSFontAttributeName
in the 'labelAttributes'
The docs for the method state:
"...the rect argument's origin field specifies the rendering origin.
The point is interpreted as the baseline origin by default.
With NSStringDrawingUsesLineFragmentOrigin, it is interpreted as the
upper left corner of the line fragment rect. ..."
What I observe (10.4.10) is that some fonts seem to honor the 'upper
left' designation for the option
'NSStringDrawingUsesLineFragmentOrigin' but some do not.
Some fonts (Garamond) seem to draw with the rect as the baseline and
so the descenders are not visible in my tight view.
Is this something that others have observed. Is there a better way
to specify the rect or accomplish this task?
All other aspects of the drawing are correct: justification, line
breaking, text color...
Thanks for any thoughts!
Steve
_______________________________________________
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