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: Ken Ferry <email@hidden>
- Date: Sun, 22 Feb 2009 14:38:11 -0800
Yes, I'm sure. :-) You won't get the subpixel font smoothing right, if
nothing else.
Also, the other method tracks whatever the current human interface design is
for text on a raised surface.
-Ken
On Sun, Feb 22, 2009 at 2:16 PM, Graham Cox <email@hidden> wrote:
>
> 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