Re: Modifying glyph storage in NSLayoutManager SOLVED

2008-03-18 Thread Douglas Davidson
On Mar 18, 2008, at 4:40 PM, Ross Carter wrote: I found that I can call the NSLayoutManager methods for modifying glyph storage (replaceGlyphAtIndex:withGlyph:, insertGlyph:atGlyphIndex:characterIndex:, etc.) without errors if I place the code in an override of NSATSTypesetter - beginLine

Re: Modifying glyph storage in NSLayoutManager SOLVED

2008-03-18 Thread Ross Carter
I found that I can call the NSLayoutManager methods for modifying glyph storage (replaceGlyphAtIndex:withGlyph:, insertGlyph:atGlyphIndex:characterIndex:, etc.) without errors if I place the code in an override of NSATSTypesetter - beginLineWithGlyphAtIndex: and inform the typesetter of any

Re: Modifying glyph storage in NSLayoutManager

2008-03-18 Thread Ross Carter
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 man

Re: Modifying glyph storage in NSLayoutManager

2008-03-17 Thread Martin Wierschin
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 stor

Re: Modifying glyph storage in NSLayoutManager

2008-03-17 Thread Ross Carter
Thank you immensely, Douglas. I've now got something working if I need to insert one or two glyphs, but it crashes on three or more glyphs. You're right, I need to fix my code for invoking the actual glyph replacement. For now, let's assume that the attributedString contains only one charac

Re: Modifying glyph storage in NSLayoutManager

2008-03-17 Thread Douglas Davidson
On Mar 17, 2008, at 9:31 AM, Ross Carter wrote: What is the correct approach to take when you need NSLayoutManager to make on-the-fly adjustments to the glyphs Usually the glyph generator is used for default glyph generation, and the typesetter is used to make adjustments to the glyphs t