• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Forcing typesetter to advance to next text container
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Forcing typesetter to advance to next text container
      • From: Aram Greenman <email@hidden>
References: 
 >Forcing typesetter to advance to next text container (From: Aram Greenman <email@hidden>)

  • Prev by Date: Re: Deleting duplicates in NSMutableArray
  • Next by Date: Re: put view between desktop and icons (was Re: Misc questions)
  • Previous by thread: Re: Forcing typesetter to advance to next text container
  • Next by thread: Re: Forcing typesetter to advance to next text container
  • Index(es):
    • Date
    • Thread