Adjust label text size
This commit is contained in:
parent
62bcecccbe
commit
fce00048ef
1 changed files with 2 additions and 2 deletions
|
@ -769,7 +769,7 @@ void PrinterWorker::convertPlaintextLabel(QString filename, Bytestream header, P
|
||||||
QString bigText = "AXgjqÈÅÄÖþ";
|
QString bigText = "AXgjqÈÅÄÖþ";
|
||||||
QRect rect = fm.boundingRect(bigText);
|
QRect rect = fm.boundingRect(bigText);
|
||||||
|
|
||||||
while(rect.height() > pixelHeight*(14.0/16))
|
while(rect.height() > pixelHeight*(8.0/10.0))
|
||||||
{
|
{
|
||||||
font.setPixelSize(font.pixelSize()-1);
|
font.setPixelSize(font.pixelSize()-1);
|
||||||
fm = QFontMetrics(font);
|
fm = QFontMetrics(font);
|
||||||
|
@ -791,7 +791,7 @@ void PrinterWorker::convertPlaintextLabel(QString filename, Bytestream header, P
|
||||||
|
|
||||||
QPainter painter(&pdfWriter);
|
QPainter painter(&pdfWriter);
|
||||||
int xOffset = -rect.x() + pixelHeight/4;
|
int xOffset = -rect.x() + pixelHeight/4;
|
||||||
int yOffset = -rect.y() + pixelHeight/16;
|
int yOffset = -rect.y() + pixelHeight/10;
|
||||||
painter.setFont(font);
|
painter.setFont(font);
|
||||||
painter.drawText(xOffset, yOffset, allText);
|
painter.drawText(xOffset, yOffset, allText);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
Loading…
Reference in a new issue