Re: Widow / Orphan protection in text layout
Re: Widow / Orphan protection in text layout
- Subject: Re: Widow / Orphan protection in text layout
- From: Gideon King <email@hidden>
- Date: Tue, 21 May 2013 08:01:19 +1000
Thanks Kyle,
This is actually a bit more than inconvenience - it causes my app to be rejected from the app store.
It's all very well overriding -currentTextContainer and returning my ivar, but I have no way of knowing if it is used in different parts of the typesetter, so could be inadvertently breaking something else, and the lack of access to methods of setting the currentTextContainerIndex or currentTextContainerSize also appears to be a show stopper.
I have not been able to find any other relevant suggestions about controlling pagination in the list archives, apart from a thread where Aki Inoue recommended doing exactly what is being done in this code.
As far as I can tell, there is no other API that will allow us to know the necessary information during typesetting and cause it to move on to the next container.
Given the lack of any other way of doing this, if there are no other suggestions, I will go back to the app store approval people and ask for an exception for this, but I don't know what my chances are. My previous experiences with them have been … less than encouraging.
Regards
Gideon
On 21/05/2013, at 2:02 AM, Kyle Sluder <email@hidden> wrote:
> The typesetter should be performing pagination, somewhere within or below -layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments: nextGlyphIndex: in the call stack.
>
> One hint that this is true is in the documentation for -[NSLayoutManager setTextContainer:forGlyphRange:], which notes that it should only be called by the typesetter during layout.
>
> As for actually keeping track of which text container you're laying into, you're right that accessing those ivars directly is bad form. If you'd like to avoid direct ivar access, add your own ivars that mimic the existing ones and override -currentTextContainer to use them. Then file a radar asking for -[NSTypesetter setCurrentTextContainerIndex:] for use by subclasses.
>
> (I haven't spent the time thinking about whether -willSetLineFragmentarect:… is the appropriate place to do pagination.)
>
> --Kyle Sluder
_______________________________________________
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