Adding Justification

Once we know how to split a large block of text into several lines, it is
quite easy to use SWI Font_Paint to plot each line in turn. The simplest
plotting style is to begin each line at the same position across the screen 
this results in left-justified, or ragged right text, as used in recent
issues of RISC User magazine. However, there are many other styles of
formatting, and while using these can be slightly more tricky, the results
are often worthwhile.

In general, to plot text in any style other than left-justified, we need to
know how much space is left over on each line after all the text that will
fit on that line has been plotted. SWI Font_ScanString is very helpful here 
it returns the width of the text that will fit on the line in R3, and simply
subtracting this from the target width will give the size of the left over
space.


Thomas Down