Re: Forcing typesetter to advance to next text container
Re: Forcing typesetter to advance to next text container
- Subject: Re: Forcing typesetter to advance to next text container
- From: Aki Inoue <email@hidden>
- Date: Mon, 5 Jul 2004 13:30:30 -0700
Aram,
If all of your text containers have the same width & line fragment
padding, you can just update currentTextContainer,
currentTextContainerIndex, and currentTextContainerSize ivars (you also
need to move the line fragment y origin to the container origin).
Unfortunately, there is no way to cancel the current paragraph layout
in the middle. So, if the new text container has a different layout
area from the current, you have to restart by tweaking
-layoutParagraphAtPoint:. SInce I received a couple requests for
rejecting the current line layout at WWDC, I'm considering to add such
functionality in a future release.
Aki
On 2004/07/05, at 2:31, Aram Greenman wrote:
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.
_______________________________________________
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.