Re: Forcing text layout

2010-03-13 Thread Sander Stoks
> In practice it probably won't because I believe the Cocoa typesetter > always produces more glyphs than characters (eg: inserting null glyphs > as padding). I'm not sure that's true - sometimes, multiple characters get replaced by a single glyph (i.c.o. ligatures). In other words: It can c

Re: Forcing text layout

2010-03-12 Thread Keith Blount
ferent after layout has finished. I do have noncontiguous layout enabled, but the above seems to work nicely either way. Thanks again! All the best, Keith - Original Message From: Martin Wierschin To: Keith Blount Cc: Cocoa Developers Sent: Fri, March 12, 2010 10:52:07 PM Subjec

Re: Forcing text layout

2010-03-12 Thread Martin Wierschin
Hello Keith! - (void)forceInitialLayout { NSInteger charIndex = (5 > [[self textStorage] length] ? [[self textStorage] length] : 5); if (charIndex > 0) { charIndex -= 1; [layoutManagerlocationForGlyphAtIndex:charIndex]; You shouldn't play loose which character/glyph indexes. I'm sur

Forcing text layout

2010-03-12 Thread Keith Blount
Hello, I have a page layout view, roughly based on the one in TextEdit although not quite the same. When text gets loaded into the page layout view, I need to force layout so that at least the first few pages get added (or removed if I'm replacing text that was already in there) properly. So fa