Full document interface of text_layout and text_line.
Add test case for bug #2037.