I'm working on an app that will have various pieces of text laid out inside paths (i.e. a non-rectangular NSTextContainer).

The requirements are:

1) Each chunk of text will be a separate object that has to know how to draw itself.

2) The objects can be moved, rotated, skewew *without* layout by changing the CTM when drawing.

3) If the path is changed by moving a control point, the text should lay itself out again.

Giving each object its own NSTextView would be overkill, as well as interfering with other things that need to be drawn.

The obvious choice is to give each object its own NSTextStorage- >NSLayoutManager->NSTextContainer setup and use -[NSLayoutManager drawGlyphsForGlyphRange:atPoint:]

The NSTextStorage is clearly required and the NSTextContainer is pretty lightweight.

But how heavy is NSLayoutManager? It has a bunch of private objects so it's hard to judge from looking at the header file. Would it be a problem handing out several dozen of them?

Cheers,

Frank
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to