A first attempt to wrap paragraphs
In the last chapter, we justified text, but only one line at the time. In this chapter, we will try to wrap an entire paragraph to create the lines. Normally, this kind algorithms do not run in PostScript, but we can program it in PostScript.
There are many sophisticated algorithms for this, including the Knuth-Plass line-breaking algorithm that optimize the spaces playing with the knowledge of all lines and using also hyphenation.
We keep it very simple. Our algorithm works like a typewriter. We write each word after another and when we see that the next word does not fit into the line width, we go to the next line.
First, we need some operators. neg negates a number (-1 mul), roll allows to access deeper elements of the stack by rolling the top elements of the stack and newpath explicitly starts a new path.