From 8cd389c0afb422011e150ce8b72857ecdb19aa65 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 1 Apr 2021 22:40:55 +0200 Subject: printing: use sensible font-size in profiles The font-size in printed profiles is based on the size of the profile in the main window. This makes no sense. Why should changing the window size change the font-size on printouts? Matter of fact, when making shrinking the height of the window to its minimum, comical printouts are obtained (font way too big). Therefore use an arbitrary rule: Say that profiles 600 pixels high look reasonable and then scale up to the actual size on the printout. This may need some tweaking for high-DPI mode. But that seems not to be supported on desktop anyway? Signed-off-by: Berthold Stoeger --- desktop-widgets/printer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp index ff5a65b93..49135d79c 100644 --- a/desktop-widgets/printer.cpp +++ b/desktop-widgets/printer.cpp @@ -150,8 +150,12 @@ void Printer::render(int pages) QSize originalSize = profile->size(); if (collection.count() > 0) { - printFontScale = (double)collection.at(0).geometry().size().height() / (double)profile->size().height(); - profile->resize(collection.at(0).geometry().size()); + // A "standard" profile has about 600 pixels in height. + // Scale the fonts in the printed profile accordingly. + // This is arbitrary, but it seems to work reasonably. + QSize size = collection[0].geometry().size(); + printFontScale = size.height() / 600.0; + profile->resize(size); } profile->setFontPrintScale(printFontScale); -- cgit v1.2.3-70-g09d2