Re: LayoutManager
Re: LayoutManager
- Subject: Re: LayoutManager
- From: Charles Jolley <email@hidden>
- Date: Mon, 26 Nov 2001 23:32:51 -0600
Just a thought...try NSLayoutManager's:
- (void)setNotShownAttribute:(BOOL)flag
forGlyphAtIndex:(unsigned)glyphIndex;
I haven't used this myself...but it looks like it might do what you are
wanting!
Cheers,
-Charles
On Monday, November 26, 2001, at 05:01 PM, Douglas Davidson wrote:
On Friday, November 23, 2001, at 06:03 AM, Gerriet M. Denkmann wrote:
I have a TextStorage where some characters have an addtitional
Attribute "Hidden".
And I want the LayoutManager NOT to display these characters.
E.g.
Storage:
some text -Now chars with Hidden- Followed by normal text
This should be displayed as:
some text @Followed by normal text
I.e. a whole range of hidden chars should be shown as "@".
Probably I have to override some methods in LayoutManger, but I cannot
figure out, which and how.
Could someone give me some clues?
Offhand I can't think of a really easy way to do this, but a few
approaches do spring to mind. First, you could create a text storage
subclass that lies about its contents under certain circumstances.
This would be somewhat tricky; for example, you have to let the layout
manager know when you change your mind. Second, you could create an
NSTypesetter subclass that modifies the glyph stream before calling the
stock typesetter. It is allowed for the typesetter to modify the glyph
stream--typically by inserting glyphs, e.g. hyphens--so in theory this
should be possible. Third, you could create an NSTypesetter subclass
that would insert an @ in the glyph stream and lay out the other glyphs
as not shown, for the hidden regions, or call the stock typesetter for
everything else.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev