Re: Text shadows in NSTextView
Re: Text shadows in NSTextView
- Subject: Re: Text shadows in NSTextView
- From: Ricky Sharp <email@hidden>
- Date: Sun, 15 Jan 2006 19:48:27 -0600
On Jan 15, 2006, at 7:01 PM, Nik Youdale wrote:
I have been searching for a way to make the text in a text view
shadowed, but am unable to find a way. How can this be done?? There
doesnt seem to be any method in NSText or NSTextView to set the
shadow of the text. I'm assuming somehow you set the shadow of the
text with the NSShadow class, but thats only a guess.
While this is possible (I've done it in an NSTextView subclass), it
doesn't really work. One of the main problems is that the shadow
metrics are not taken into consideration when laying out the text.
So say you have two lines of text. The second line will slightly
overlap the shadow of the first line. So when you do things like
text selection on the second line, it will leave many rendering
artifacts on the screen.
Also, I had a tough time applying the necessary changes to a custom
field editor.
What may be related is an issue when drawing attributed strings with
shadows. Since most shadows are to the right and below, you'll get
clipping on bottom and right edges if drawing in the rectangle you
get back from sending a size message to the string. I filed <rdar://
3910767> about this in Dec. 2004, but nothing has been done on it
yet. The workaround was to pad the rectangle appropriately based on
the shadow metrics (offset, blur, etc.)
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden