How can I get attributed string info in a form I can save?
How can I get attributed string info in a form I can save?
- Subject: How can I get attributed string info in a form I can save?
- From: Dave Camp <email@hidden>
- Date: Tue, 8 Mar 2005 11:59:32 -0800
I'm working on a cross platform chat application. In the text entry
area, the user can change text attributes (e.g. bold. italics, font,
etc) we you would expect. I need to be able to capture the ranges of
various attributes and encode them into something I can send over the
network.
My first attempt that this used [NSAttributedString
attributesAtIndex:effectiveRange:] to get the range for each set of
attributes. However, it appears that changes like bold, italics, etc,
are encoded into a single key/value pair like:
NSFont = "CGS Helvetica-Bold 12.00 pt. P [] (0x0035d6b0)
fobj=0x0033b9c0, spc=3.33";
NSParagraphStyle = Alignment 4, LineSpacing 0, ParagraphSpacing 0,
ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0,
FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0,
LineBreakMode 0, Tabs (28L, 56L, 84L, 112L, 140L, 168L, 196L, 224L,
252L, 280L, 308L, 336L), DefaultTabInterval 0;
I need to be able to encode the style information into some custom XML
(very much like converting the text into HTML). I was hoping Cocoa
would give me something broken down into more detail like:
font = Helvetica
bold = yes
size = 12.00 pt
etc...
How can I get more useful style information about the text? Am I really
expected to be able to parse strings like those shown above? There must
be another way of doing this.
Thanks,
Dave
---
You are in a maze of testy little Java VMs, all subtly different.
_______________________________________________
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