• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get the "white shadow" effect when drawing NSStrings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to get the "white shadow" effect when drawing NSStrings?
      • From: Steve Christensen <email@hidden>
    • Re: How to get the "white shadow" effect when drawing NSStrings?
      • From: Graham Cox <email@hidden>
References: 
 >How to get the "white shadow" effect when drawing NSStrings? (From: Ulai Beekam <email@hidden>)
 >Re: How to get the "white shadow" effect when drawing NSStrings? (From: Brandon Walkin <email@hidden>)
 >RE: How to get the "white shadow" effect when drawing NSStrings? (From: Ulai Beekam <email@hidden>)
 >Re: How to get the "white shadow" effect when drawing NSStrings? (From: Ken Ferry <email@hidden>)
 >Re: How to get the "white shadow" effect when drawing NSStrings? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Next by Date: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Previous by thread: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Next by thread: Re: How to get the "white shadow" effect when drawing NSStrings?
  • Index(es):
    • Date
    • Thread