Skip to content

Commit

Permalink
Adjust label text size
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Jan 29, 2023
1 parent 62bcecc commit fce0004
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/printerworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ void PrinterWorker::convertPlaintextLabel(QString filename, Bytestream header, P
QString bigText = "AXgjqÈÅÄÖþ";
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);
fm = QFontMetrics(font);
Expand All @@ -791,7 +791,7 @@ void PrinterWorker::convertPlaintextLabel(QString filename, Bytestream header, P

QPainter painter(&pdfWriter);
int xOffset = -rect.x() + pixelHeight/4;
int yOffset = -rect.y() + pixelHeight/16;
int yOffset = -rect.y() + pixelHeight/10;
painter.setFont(font);
painter.drawText(xOffset, yOffset, allText);
painter.end();
Expand Down

0 comments on commit fce0004

Please sign in to comment.