Re: Text layout responsibility
Re: Text layout responsibility
- Subject: Re: Text layout responsibility
- From: Martin Wierschin <email@hidden>
- Date: Thu, 11 Dec 2008 17:10:41 -0800
Hello Rimas,
I am trying to implement editable text view which changes text
position (paragraphs positions, to be exact) according to the some
text attributes. I know, that NSTextContainer is responsible for
line rects calculation when text should be placed in known shape.
Is it responsible for this when position depends on text attributes
also?
The text container isn't really responsible for that. It's job is to
merely define the geometric space available for text. I would expect
you'll find it easier to override NSTypesetter's
"willSetLineFragmentRect:forGlyphRange:etc:" method.
Another thing I'd like to ask, is where should I adjust text view/
text container size if this is necessary while typing? I have tried
to do this after getting NSTextStorageDidProcessEditingNotification
notification. But that raises an exception:
NSLayoutManager is touchy about changing NSTextContainer geometry
during layout, but I would expect it to be safe to do so in response
to that notification. Are you perhaps altering the contents of your
NSTextStorage in response to layout events/notifications? Can you
post the full stack backtrace for the exception?
~Martin
_______________________________________________
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