Re: end of paragraph in NSTextView
Re: end of paragraph in NSTextView
- Subject: Re: end of paragraph in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Mon, 26 Apr 2004 13:14:38 -0700
On Apr 26, 2004, at 12:52 PM, Mark Munz wrote:
Unfortunately, these two calls only work on Panther which is bad for
me (for the moment). I'm targeting 10.2.8 or later with my App. This
may change, but for now I haven't been able to use any Panther only
features for my project.
For the record, I said NSTextView, I should have said that it was
NSMutableAttributedStrings I'm working with. My bad on that. Just so
there is no confusion.
Am I correct in assuming that the text could have any variation of
CR+LF or LF or CR or Unicode Paragraph Sep in it? I can make
adjustments for it if that's the case, I'm just trying to understand
it. I can make the right adjustments like pre-flighting the text and
standardizing the end-of-paragraphs to a single format. At least until
I can require Panther. :-)
Pre-Panther you can use the corresponding lineRange calls, which are
similar but also count Unicode line separator as a break. In Panther
we started to make a more rigorous distinction between hard line breaks
and paragraph breaks.
The actual line breaks that you will find in your text depend on where
it comes from. If it was generated by Cocoa--for example, via import
from RTF or the like--it will use \n. If it comes from Unix tools, it
will use \n also. If it comes from other sources, it may use \r or
\r\n. The Cocoa text system tries to handle all of these rather than
making assumptions as to which will be present, and in the absence of
particular knowledge, we recommend that you do likewise.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.