addText
Typesets spans into shapes and adds the result. Shapes are filled from top to bottom, text flows from one shape to the next, see typesetText for details.
This is an extension function because on the JVM it would otherwise clash with TextDrawer.addText for boxes.