that this is something your browser should do if the output is for the web. However, if you're interested in this kind of formatting for other applications as well, take a look at the unix
). It does clever things like find the best way to arrange line breaks so that each line in the paragraph is more or less the same length as the ones around it.