Import text rendering improvements from CATSFC.

* commit 936cb38b5e0e67c50cf35d23f81059b4a6493ce8: centered text improvements, cutting on spaces instead of in the middle of words, or at \n.
* commit 37ef0a9b8d92fd39f3a3cd2d605ea8a28eaa8453: fix scrollers broken by the commit above, and simplify the code.