Font size paint by QPainter do not looks consistent under different resolution
Solved
General and Desktop
-
As the title mentioned, I draw the text on different images with different resolutions with
QPainter painter(&result); QFont font("Verdana"); font.setWeight(QFont::ExtraBold); font.setPixelSize(20); painter.setFont(font); painter.drawText(static_cast<int>(i.x), static_cast<int>(i.y - 16), obj_name.c_str());
How could I make the size of the text looks consistent under different resolution?Thanks
-
Hi,
Do you mean the text should grow depending on the size of the widget ?
-
@SGaist Nope, I mean the text draw on the image. I find out the reason already, I forgot I resize the image if their width or height bigger than certain value, that is what makes the size of the same pixels become different, yet another stupid bug :)