• 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
NSLayoutManager and whitespace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSLayoutManager and whitespace


  • Subject: NSLayoutManager and whitespace
  • From: Scott Thompson <email@hidden>
  • Date: Thu, 13 Apr 2006 02:52:56 -0500

I'm trying to measure some text using NSLayoutManager and I'm having trouble with trailing whitespace.

What I want to do is measure some text which will be drawn later. The problem I'm having is for lines of text with trailing whitespace. The simplest case would be a single word with a space after it i.e. "Preferences_" (the underscore character in this case represents a space)

When I measure this string with a text layout object, it returns a width of something like 67 (for a particular font etc...).

If I then come back and draw that string into a field that is 67 points wide, the string hyphenates and wraps.

What I think is happening is that my text field is wide enough for "Preferences", but is not wide enough for "Preferences_" so when the typesetter sees it's not going to fit, it hypenates and wraps.

I've tried just about every line fragment rect routine I can find. Is there some way to get the entire advance width of a line from the layout manager?

Scott

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSLayoutManager and whitespace
      • From: Ondra Cada <email@hidden>
  • Prev by Date: problem NsMatrix and image
  • Next by Date: Re: CoreData faulting - does it rely on #self?
  • Previous by thread: problem NsMatrix and image
  • Next by thread: Re: NSLayoutManager and whitespace
  • Index(es):
    • Date
    • Thread