Hello Cocoa people,

With traditional Cocoa text drawing, it is possible to determine the size of a piece of text ahead of time with methods like NSString's sizeWithAttributes: or with NSCell's cellSizeForBounds:. These methods allow the determination of the width of some text, or the number of lines the text would require given a particular width.

But how is it possible to determine these things for a CATextLayer? That is, and as a specific question: given a CATextLayer with some text and font specifications, and a fixed width, how can I determine the number of lines it would require?

Is part of the answer the CATextLayer's bounds, and is this set up correctly before calling its preferredFrameSize method? However, this doesn't provide the actual number of lines the text would take.

Do you know how to determine the number of lines in a CATextLayer?


Thank you in advance!

Karl

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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