Search code examples
iphoneipaduiwebviewformattinghyphenation

How can I hyphenate words on the fly while displaying text?


I am making an iPad app where I am trying to mimic very closely the look and feel of an existing hard back book. I have the content of the book in digital text, but it contains all of the words, and no hyphens for line breaks.

The book I am trying to mimic exactly has a number of line breaks where hyphens occur, how could I go about mimicking that look? I want the iPad app to look EXACTLY the same as the original book, including the placement of words on lines, etc. I am going to be pulling the text from a db using fmdb and displaying it in a UIWebView.

What could I do to break words and hyphenate them when there is no more room in the row?


Solution

  • This might be of some use to you:

    http://frankzblog.appspot.com/?p=7001