Re: Determining whether text fully fits in a box
Re: Determining whether text fully fits in a box
- Subject: Re: Determining whether text fully fits in a box
- From: Rob Keniger <email@hidden>
- Date: Sat, 13 Jun 2009 12:47:04 +1000
On 13/06/2009, at 12:34 PM, Graham Cox wrote:
What's the easiest way to tell if a given bit of text fits a text
container? I see there is a delegate method that is called when text
doesn't fit, but it would be more convenient if I could just query
the layout manager and ask it whether it fitted the text or it
overflowed. I need to draw some sort of visual indication that there
is more text than is visible, much like InDesign does it.
I'm handling all my own text layout with NSLayoutManager and
friends, but I couldn't see an easy way to simply ask it and get a
yes/no answer.
Jerry Krinock's NS(Attributed)String+Geometrics category is great for
measuring text exactly, I don't know if that would help you:
http://sheepsystems.com/sourceCode/sourceStringGeometrics.html
--
Rob Keniger
_______________________________________________
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