Re: How to get the "white shadow" effect when drawing NSStrings?
Re: How to get the "white shadow" effect when drawing NSStrings?
- Subject: Re: How to get the "white shadow" effect when drawing NSStrings?
- From: Graham Cox <email@hidden>
- Date: Mon, 23 Feb 2009 09:16:51 +1100
On 23/02/2009, at 4:43 AM, Ken Ferry wrote:
This effect cannot be implemented with text attributes.
Are you sure? This gets awfully close, unless I'm missing the point
here (the font to use your choice):
+ (NSDictionary*) defaultTitleAttributes
{
// return the dictionary used to specify the attributes for drawing
the title string in the palette windows. Override to
// customize the title string
static NSDictionary* sTitleAttrs = nil;
if ( sTitleAttrs == nil )
{
NSFont* font = [NSFont boldSystemFontOfSize:11.0];
NSMutableParagraphStyle* style = [[NSParagraphStyle
defaultParagraphStyle] mutableCopy];
[style setAlignment:NSCenterTextAlignment];
NSShadow* shadw = [[NSShadow alloc] init];
[shadw setShadowColor:[NSColor whiteColor]];
[shadw setShadowOffset:NSMakeSize( 0, -1.5 )];
[shadw setShadowBlurRadius:1.0];
sTitleAttrs = [NSDictionary
dictionaryWithObjectsAndKeys:font,NSFontAttributeName,
style,NSParagraphStyleAttributeName,
shadw, NSShadowAttributeName,
nil];
[sTitleAttrs retain];
[style release];
[shadw release];
}
return sTitleAttrs;
}
--Graham
_______________________________________________
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