CATextLayer metrics
CATextLayer metrics
- Subject: CATextLayer metrics
- From: Karl Goiser <email@hidden>
- Date: Fri, 29 Feb 2008 07:25:33 +1100
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 (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