Finish the text API

There were some bugs in the processing of header types, and the per-symbol
layout for plain text was a stub. That layout is now finished and working.