Forcing typesetter to advance to next text container
Forcing typesetter to advance to next text container
- Subject: Forcing typesetter to advance to next text container
- From: Aram Greenman <email@hidden>
- Date: Mon, 5 Jul 2004 02:31:55 -0700
I have a text system which uses a series of text containers sharing the
same layout manager. During the layout phase, at certain glyphs I want
to move to the next text container even if the current text container
has room left.
I thought overriding -[NSATSTypesetter
willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:] to zero
out the the line fragment rect would do this, but this just makes the
typesetter think the glyphs will actually fit in a zero rect and messes
up the layout.
Basically, here's what I want my typesetter to do, but
-advanceToNextTextContainer and -restartLayoutFromGlyphIndex: don't
exist ;-)
Any ideas are greatly appreciated, I'm stumped on this one.
@implementation MyATSTypesetter
- (void)willSetLineFragmentRect:(NSRect *)lineRect
forGlyphRange:(NSRange)glyphRange
usedRect:(NSRect *)usedRect
baselineOffset:(float *)baselineOffset
{
if (glyphRange.location == someNumber) {
[self advanceToNextTextContainer];
[self restartLayoutFromGlyphIndex:glyphRange.location];
}
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.