• 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: Modifying glyph storage in NSLayoutManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying glyph storage in NSLayoutManager


  • Subject: Re: Modifying glyph storage in NSLayoutManager
  • From: Ross Carter <email@hidden>
  • Date: Tue, 18 Mar 2008 16:28:36 -0400


On Mar 17, 2008, at 11:19 PM, Martin Wierschin wrote:
I have some text items whose glyphs cannot be determined until layout. The text string might contain a marker to draw the current page number, or to sequentially number paragraphs, etc. The glyphs can be determined only by the layout manager; different layout managers for the same text storage might display different page numbers, for example.

One alternative to the glyph generator is to subclass NSTextAttachment. The attachment cell can query the text container / layout manager for any information it needs during cell frame calculation and drawing.


~Martin

Thanks Martin, that might well be the only solution. I'm going to fiddle with glyph storage a while longer before I give up and try NSAttachment. Following Douglas's advice on looking to the typesetter rather than the glyph generator or layout manager, I've been hitting NSATSTypesetter with everything I can think of. Maybe I'm just pushing the text system too hard. For example, the typesetter method - (void)substituteGlyphsInRange:(NSRange)glyphRange withGlyphs:(NSGlyph *)glyphs looks mighty promising, and the docs say the method can be overridden by subclasses, but apparently it works only if you replace the glyphs on a 1-for-1 basis. Or maybe I'm just not calling it at the right time.


Ross
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Modifying glyph storage in NSLayoutManager SOLVED
      • From: Ross Carter <email@hidden>
References: 
 >Modifying glyph storage in NSLayoutManager (From: Ross Carter <email@hidden>)
 >Re: Modifying glyph storage in NSLayoutManager (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: interface builder 3 question
  • Next by Date: Re: interface builder 3 question
  • Previous by thread: Re: Modifying glyph storage in NSLayoutManager
  • Next by thread: Re: Modifying glyph storage in NSLayoutManager SOLVED
  • Index(es):
    • Date
    • Thread