Re: Outlined Text with 2 colors
Re: Outlined Text with 2 colors
- Subject: Re: Outlined Text with 2 colors
- From: Douglas Davidson <email@hidden>
- Date: Thu, 21 Apr 2005 13:23:57 -0700
On Apr 21, 2005, at 1:09 PM, Lorenzo wrote:
Hi,
with TextEdit application, and with the Cocoa text APIs, I can
quite set the
style "Outlined" to a string. But when I do so, I can choose one
only color:
the border color. The internal area is transparent, like a hole.
How can I set a color for the border and a color for the internal
area?
I mean programmatically. Thank you.
See <AppKit/NSAttributedString.h>, the description of
NSStrokeWidthAttributeName. What you want is to have both stroke and
fill, so you should set a negative value for that attribute. The
fill color will be the foreground color; the stroke color will be
given by NSStrokeColorAttributeName, defaulting to the foreground
color if that attribute is absent, so you should set both
NSForegroundColorAttributeName and NSStrokeColorAttributeName.
Douglas Davidson
_______________________________________________
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