What I want to do is to make a simple word processor that will handle Tibetan Unicode and allow the user to specify some simple layout and be able to print everything out to paper. Code: https://gist.github.com/ironhouzi/10564915. Output: qtextlayout_test1.jpg

One of the problems I have to solve is that Tibetan being both horizontally and vertically oriented, can in rare cases have stacks that extend past the bottom line of the font (font descent). This is demonstrated in the beginning of the first two lines in the attached image. I have had to manually shorten and move the English line below to give room for the tall Tibetan glyph stack. I need to find a way to programatically detect when such a glyph stack is present so I can make the necessary line adjustments.

I've come across this example: http://stackoverflow.com/questions/1...-a-qt-document

So I need to use QTextDocument, but how do I add my two QTextLayouts to the QTextDocument? I've tried to use QTextDocument.setDocumentLayout(), but this takes a QAbstractTextDocument as argument.

I could really need some guidance here, since there's not that much information on the lower level text rendering parts of Qt.

Am I going down a dead end path?

If anybody knows any books that explains the finer points of text rendering in Qt in great detail, I would love to know about it.