FROM : R. Scott Thompson
DATE : Thu Dec 09 18:56:02 2004
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
DATE : Thu Dec 09 18:56:02 2004
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
| Related mails | Author | Date |
|---|---|---|
| R. Scott Thompson | Dec 9, 18:56 | |
| Douglas Davidson | Dec 9, 20:55 | |
| John Stiles | Dec 9, 22:40 | |
| Andrew Farmer | Dec 10, 00:45 | |
| John Stiles | Dec 10, 01:03 | |
| R. Scott Thompson | Dec 10, 02:30 | |
| Ali Ozer | Dec 10, 20:47 | |
| R. Scott Thompson | Dec 10, 20:52 |






Cocoa mail archive

