• 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: Ali Ozer <email@hidden>
  • Date: Fri, 10 Dec 2004 11:47:59 -0800

I think if you put a variant of black in the attributed string that doesn't compare isEqual: to [NSColor blackColor], it will get through. Simplest way might be to create a black with [NSColor calibratedColorWithRed:green:blue:alpha:], rather than using [NSColor blackColor].
Ali




Begin forwarded message:

From: "R. Scott Thompson" <email@hidden>
Date: December 9, 2004 9:56:02 AM PST
To: Cocoa-Dev Development <email@hidden>
Subject: Forcing Black on RTF Text generated from NSAttributedString

The default text color for an NSAttributedString is black. If I extract RTF from a plain, black, string the resulting RTF doesn't have black in it's table, and it doesn't include a color directive that leads me to believe it should be marked as black.

When I take that RTF data to a PC running our application what I get out is a gray looking text (for some reason).

I'd like to force the text in my string which doesn't have a color associated with it, to use black. I wrote some code that runs through the string and for every text range that doesn't have a color associated with it, it tries to set the color for that range to black.

Unfortunately (or not) the addAttribute: routine is clever enough to figure out that I'm trying to add black as a color so it refuses to actually add the color to the text range. If I check the string after my addition, the attribute for that range of text is still NULL. :-(

Is there any way to tell the attributed string "No really, I want to store black, explicitly, as the foreground color of this range of text.... I really, really 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

_______________________________________________ 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: "R. Scott Thompson" <email@hidden>
References: 
 >Forcing Black on RTF Text generated from NSAttributedString (From: "R. Scott Thompson" <email@hidden>)

  • Prev by Date: Re: Aqua icons from system fonts
  • 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