• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining whether text fully fits in a box [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining whether text fully fits in a box [SOLVED]


  • Subject: Re: Determining whether text fully fits in a box [SOLVED]
  • From: Graham Cox <email@hidden>
  • Date: Sun, 14 Jun 2009 01:19:03 +1000

I found an easy way to do this for my situation, which has only a single text container - just compare the glyph range for the container against the entire glyph range. If they're the same, all text was laid out, if not, it overflowed.

--Graham



On 13/06/2009, at 12:34 PM, Graham Cox wrote:

Hi all,

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.

_______________________________________________

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


References: 
 >Determining whether text fully fits in a box (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Coming up with ideas
  • Next by Date: Re: NSView directly drawn on screen?
  • Previous by thread: Re: Determining whether text fully fits in a box
  • Next by thread: "Leaks" utility
  • Index(es):
    • Date
    • Thread