diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | desktop-widgets/printer.cpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f19c881..412303665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ - +printing: use sensible font size even for strange window size --- * Always add new entries at the very top of this file above other existing entries and this note. 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); |