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: Mike Ferris <email@hidden>
- Date: Mon, 5 Jul 2004 09:08:24 -0700
If your needs are relatively simple, you can just insert a container
break in the text. Cocoa will move on to the next container when it
finds a form feed (NSFormFeedCharacter). Try typing Ctrl-Q, Ctrl-L
into a textEdit window that is set to Wrap to Page mode and you'll see
this in action...
If you can't alter the actual text with container break characters,
then you'll probably need a typesetter subclass, and I don't have much
advice on how to do that.
Mike
Begin forwarded message:
>
From: Aram Greenman <email@hidden>
>
Date: July 5, 2004 2:31:55 AM PDT
>
To: email@hidden
>
Subject: Forcing typesetter to advance to next text container
>
>
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.