• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: LayoutManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LayoutManager


  • Subject: Re: LayoutManager
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 26 Nov 2001 15:01:35 -0800

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


  • Follow-Ups:
    • Re: LayoutManager
      • From: Charles Jolley <email@hidden>
References: 
 >LayoutManager (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: drawing pixels in NSView
  • Next by Date: Re: Internal Modem
  • Previous by thread: Re: LayoutManager
  • Next by thread: Re: LayoutManager
  • Index(es):
    • Date
    • Thread