• 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: How to truncate NSStrings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to truncate NSStrings?


  • Subject: Re: How to truncate NSStrings?
  • From: Andy <email@hidden>
  • Date: Thu, 25 Jul 2002 00:39:09 -0400

Simon Fraser wrote:
>
> I'm quite familiar with [NSString substringWithRange]. That's not
> what I'm asking. I want some truncation methods that:
>
> i) can truncate based on measure string width, rather than number
> of characters.
>
> ii) are international-friendly (e.g. won't truncate in the middle
> of a required ligature, and will insert an appropriate ellipsis).
>

Hi Simon ;)

I recall hearing that one of the cocoa apis was documented as being able
to do the ellipsis thing (it was on this list months ago), but that it
wasn't implemented in 10.1.

NSLayoutManager is the class I would look at to try to figure a solution
that's aware of things like ligatures and figure out how wide strings
are. However, I don't think it has a function built in that will do what
you ask.


--
AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

(see you later space cowboy ...)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How to truncate NSStrings? (From: Andrew Pinski <email@hidden>)
 >Re: How to truncate NSStrings? (From: email@hidden (Simon Fraser))

  • Prev by Date: Re: What is the purpose of static typing?
  • Next by Date: Re: about memory
  • Previous by thread: Re: How to truncate NSStrings?
  • Next by thread: Re: How to truncate NSStrings?
  • Index(es):
    • Date
    • Thread