How to draw outline text on
QImage
QPainterPath::addText()
path.addText(rect.bottomLeft(), font, text);
p.strokePath(path, pen);
p.drawText(rect, flag, text);
p
QPainter
rect
flag
Qt::AlignRight
Qt::TextWordWrap
I found this solution: I draw the text in the buffer (using QPainter.drawText), calculate the SDF, and make outline.
https://en.wikipedia.org/wiki/Signed_distance_function
https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817