• 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: Forcing Black on RTF Text generated from NSAttributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing Black on RTF Text generated from NSAttributedString


  • Subject: Re: Forcing Black on RTF Text generated from NSAttributedString
  • From: "R. Scott Thompson" <email@hidden>
  • Date: Thu, 9 Dec 2004 13:46:00 -0600

I haven't tested this, but you could try using an NSColor that is not equal to [NSColor blackColor], but whose RGB components are 0. I believe it is sufficient to use colorWithCalibratedRed:green:blue:alpha: but if necessary you could use a custom NSColor subclass.

BAH!!! I found a bug in my test code. It turns out that this DOES work, (using a separate instance of black created with colorWithCalibratedRed...).


As it turns out, however, if you then round-trip that same code through RTF (that is, you generate an RTF from it, and then generate a string from the RTF) you loose all the lovely work you did in applying your own black to the ranges.

That is what I would expect to happen... it's not what I want to happen in this particular case... but it seems like the Right Thing™ to do.

Scott

_______________________________________________
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


  • Follow-Ups:
    • Re: Forcing Black on RTF Text generated from NSAttributedString
      • From: Douglas Davidson <email@hidden>
References: 
 >Forcing Black on RTF Text generated from NSAttributedString (From: "R. Scott Thompson" <email@hidden>)
 >Re: Forcing Black on RTF Text generated from NSAttributedString (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Protocol implementation split between base and derived class
  • Next by Date: Re: Forcing Black on RTF Text generated from NSAttributedString
  • Previous by thread: Re: Forcing Black on RTF Text generated from NSAttributedString
  • Next by thread: Re: Forcing Black on RTF Text generated from NSAttributedString
  • Index(es):
    • Date
    • Thread