font = QtGui.QFont("Arial", 40)stringA = "This is a test"path = QtGui.QPainterPath()path.addText(QtCore.QPointF(0, 0), font, stringA)poly = path.toSubpathPolygons()