Re: [SOLVED--AGAIN] Re: Printing a range of text in a particular container --
Re: [SOLVED--AGAIN] Re: Printing a range of text in a particular container --
- Subject: Re: [SOLVED--AGAIN] Re: Printing a range of text in a particular container --
- From: Douglas Davidson <email@hidden>
- Date: Mon, 5 Jan 2009 12:52:06 -0800
On Dec 29, 2008, at 11:35 AM, John Velman wrote:
Martin -- still thanks, but, I found a fourth method:
NSLayoutManager -setTextContainer:forGlyphRange:
This method isn't really suitable for general use. This method is
intended to be called by the typesetter during the layout process, and
it needs to be called as part of a certain sequence of calls in a
certain order that the typesetter makes to the layout manager to tell
it where text should be laid out. This is generally described in "The
Layout Process" in <http://developer.apple.com/documentation/Cocoa/Conceptual/TextLayout/Concepts/LayoutManager.html#//apple_ref/doc/uid/20001805
>, but for the exact sequence of calls, read the comments in the
section of NSLayoutManager.h starting with -
setTextContainer:forGlyphRange:. If you were to make a custom
typesetter, it would call these methods on the layout manager. These
methods can in principle be called outside of a typesetter, but in
practice there are significant restrictions--note for example the
comments stating that -setTextContainer:forGlyphRange: resets many
layout attributes, because it is intended to be called first in the
layout sequence and immediately followed by the setting of the other
attributes.
In general, if you want to force a range of text to start in a
particular container, a form feed is the way to go. It's much easier
to let the text system use the default typesetter to lay out the text
for you. Alternatively, of course, you could use two different layout
managers and text storages--if the two pieces of text are really being
displayed independently, they may not actually belong in the same
document.
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden