FROM : Douglas Davidson
DATE : Thu Jan 10 20:44:14 2008
On Jan 10, 2008, at 9:45 AM, I. Savant wrote:
> Ah! I stand corrected, Douglas, thanks. My original point still
> remains, though - unless you're using it for misspelled words, you'll
> need to come up with your own marker. This means (unless I'm further
> mistaken), creating your own temporary attribute, setting it on the
> attributed string, then properly rendering it in the text view (which,
> IMO, is done most easily by drawing it on the text view itself via
> -drawViewBackgroundInRect:).
Yes, in general I would not recommend using the spelling indicator for
purposes that diverge radically from its original signification. If
you need to do custom drawing of this sort that depends on the
location of individual glyphs, it's probably easiest to do so by
subclassing NSLayoutManager, and overriding one of its drawing
methods. I believe we have examples available of this technique. The
regions of text requiring special drawing can be indicated either by
ordinary attributes on the text, or by temporary attributes on the
layout manager, depending on the persistence of the attributes in
question.
Douglas Davidson
DATE : Thu Jan 10 20:44:14 2008
On Jan 10, 2008, at 9:45 AM, I. Savant wrote:
> Ah! I stand corrected, Douglas, thanks. My original point still
> remains, though - unless you're using it for misspelled words, you'll
> need to come up with your own marker. This means (unless I'm further
> mistaken), creating your own temporary attribute, setting it on the
> attributed string, then properly rendering it in the text view (which,
> IMO, is done most easily by drawing it on the text view itself via
> -drawViewBackgroundInRect:).
Yes, in general I would not recommend using the spelling indicator for
purposes that diverge radically from its original signification. If
you need to do custom drawing of this sort that depends on the
location of individual glyphs, it's probably easiest to do so by
subclassing NSLayoutManager, and overriding one of its drawing
methods. I believe we have examples available of this technique. The
regions of text requiring special drawing can be indicated either by
ordinary attributes on the text, or by temporary attributes on the
layout manager, depending on the persistence of the attributes in
question.
Douglas Davidson
| Related mails | Author | Date |
|---|---|---|
| Ivan C Myrvold | Jan 10, 14:07 | |
| I. Savant | Jan 10, 17:13 | |
| Douglas Davidson | Jan 10, 18:37 | |
| I. Savant | Jan 10, 18:45 | |
| Douglas Davidson | Jan 10, 20:44 | |
| Ivan C Myrvold | Jan 10, 21:05 |






Cocoa mail archive

