Skip navigation.
 
mlRe: NSAttributedString attribues misbehaving
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

Related mailsAuthorDate
mlNSAttributedString attribues misbehaving Robert Clair Nov 23, 14:06
mlRe: NSAttributedString attribues misbehaving Guy English Nov 23, 16:20
mlRe: NSAttributedString attribues misbehaving Douglas Davidson Nov 23, 18:06
mlRe: NSAttributedString attribues misbehaving Robert Clair Nov 23, 20:36