• 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: Outlined Text with 2 colors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Outlined Text with 2 colors (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: Help in dissertation ideas
  • Next by Date: Re: over-riding keyDown
  • Previous by thread: Outlined Text with 2 colors
  • Next by thread: Toolbar button not disabling while modal window up
  • Index(es):
    • Date
    • Thread