Here's a puzzle for you. I have a horizontal slider that loads pages via Ajax, with pre-loading features to maintain smooth performance. Similar to Facebook Billboarding but with a slight twist. By determining the viewport size, I calculate boxSizeX and boxSizeY.
The server sends a block of text containing X words. The text is displayed using a monospaced font with a 13px font size and a line-height of 1em (also 13px). My challenge now is to break down the text into chunks that fit perfectly within boxSizeX and boxSizeY without cutting words in half or splitting sentences before the last two words. Any suggestions on potential obstacles to watch out for would be greatly appreciated as I want to cover all bases.
All this computation is done in JavaScript, though the initial call for text can include serving boxSize values to the server for heavy processing. How would you approach this task? I'm not certain about everything I need to consider such as browser rendering, font issues, and more. Thank you for any insights!