QTextLayout

class PyQt5.QtGui.QTextLayout

C++ documentation