2

For laying out the text in a view, I would like to know if it's possible to do the following:

given a string S, frame size and font size => return range (NSRange) of characters that I can use to substring S, which of course will fit into the frame.

thanks!

H.Rabiee
  • 4,747
  • 3
  • 23
  • 35
  • If you are displaying the string in a `UITextView`, you can use the answer here: http://stackoverflow.com/a/9283311/77567 – rob mayoff Mar 04 '12 at 08:05
  • I would like to use CoreText actually since I'm aiming towards an ebook reader. – H.Rabiee Mar 04 '12 at 16:11
  • Do you want to measure how much text fits in a single line with a fixed width? Or how much text fits in a given rectangle, with word wrapping? – rob mayoff Mar 04 '12 at 16:46
  • The latter, how much text fits in a given rectangle with word wrapping and some font size. – H.Rabiee Mar 04 '12 at 20:52

0 Answers0