FROM : Douglas Davidson
DATE : Tue Nov 23 18:06:02 2004
On Nov 23, 2004, at 5:06 AM, Robert Clair wrote:
> I set the text color by setting NSForegroundColorAttributeName in an
> attributes dictionary and calling [NSTextView setTypingAttibutes:].
> OK so far, works as expected. But then I also set
> NSStrokeColorAttributeName
> and NSStrokeWidthAttributeName to outline the text in a contrasting
> color.
> I get my outline... but the fill disappears.
The value of NSStrokeWidthAttributeName controls this. It should be a
float-valued NSNumber, of which the absolute value controls the stroke
width, and the sign controls the drawing mode; a positive value causes
drawing using stroke alone, a negative value causes stroke and fill
drawing, and zero (or no value) causes fill only. If
NSForegroundColorAttributeName is present, it is used as the fill color
(if fill is drawn); if it is absent, the fill color is black (if fill
is drawn). If NSStrokeColorAttributeName is present, it is the color
used for the stroke (if stroke is drawn); if it is absent, the fill
color is also used for the stroke (if stroke is drawn). See
<AppKit/NSAttributedString.h>.
Douglas Davidson
DATE : Tue Nov 23 18:06:02 2004
On Nov 23, 2004, at 5:06 AM, Robert Clair wrote:
> I set the text color by setting NSForegroundColorAttributeName in an
> attributes dictionary and calling [NSTextView setTypingAttibutes:].
> OK so far, works as expected. But then I also set
> NSStrokeColorAttributeName
> and NSStrokeWidthAttributeName to outline the text in a contrasting
> color.
> I get my outline... but the fill disappears.
The value of NSStrokeWidthAttributeName controls this. It should be a
float-valued NSNumber, of which the absolute value controls the stroke
width, and the sign controls the drawing mode; a positive value causes
drawing using stroke alone, a negative value causes stroke and fill
drawing, and zero (or no value) causes fill only. If
NSForegroundColorAttributeName is present, it is used as the fill color
(if fill is drawn); if it is absent, the fill color is black (if fill
is drawn). If NSStrokeColorAttributeName is present, it is the color
used for the stroke (if stroke is drawn); if it is absent, the fill
color is also used for the stroke (if stroke is drawn). See
<AppKit/NSAttributedString.h>.
Douglas Davidson
| Related mails | Author | Date |
|---|---|---|
| Robert Clair | Nov 23, 14:06 | |
| Guy English | Nov 23, 16:20 | |
| Douglas Davidson | Nov 23, 18:06 | |
| Robert Clair | Nov 23, 20:36 |






Cocoa mail archive

