Autoselect font size to avoid wrapping.

The old heuristic choses a giant font when the student's
program is short enough to fit without vertical scrolling, but
it does not pay attention to horizontal wrapping.

This commit adds logic to be aware of the width of the text:
if it is wider than the window to begin with, or if later some
changes cause wrapping to occur, the small font is used.