set dots per meter on image when drawing text

Fixes #1805
This commit is contained in:
itsmattkc
2021-12-29 10:01:01 -08:00
parent 3c95ff7ac8
commit 1fedcf628f
+6
View File
@@ -117,7 +117,13 @@ void TextGenerator::GenerateFrame(FramePtr frame, const GenerateJob& job) const
QImage img(frame->width(), frame->height(), QImage::Format_Grayscale8);
img.fill(Qt::transparent);
// 72 DPI in DPM (72 / 2.54 * 100)
const int dpm = 2835;
img.setDotsPerMeterX(dpm);
img.setDotsPerMeterY(dpm);
QTextDocument text_doc;
text_doc.documentLayout()->setPaintDevice(&img);
// Set default font
QFont default_font;