Bug 100604 - font sizes in printed website pages (konqueror) are not independend from screen font sizes
Summary: font sizes in printed website pages (konqueror) are not independend from scre...
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: khtml printing (show other bugs)
Version: 3.3.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords: triaged
: 53189 78574 100807 140833 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-01 23:44 UTC by Damir Perisa
Modified: 2018-10-27 03:44 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
comparison of printprevies (483.13 KB, image/jpeg)
2005-04-06 19:01 UTC, Andreas Stoehr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Damir Perisa 2005-03-01 23:44:23 UTC
Version:           3.3.2 (using KDE 3.3.2, Arch Linux)
Compiler:          gcc version 3.4.3
OS:                Linux (i686) release 2.6.11-rc5-mm1-ARCH

this bug is related to all this bugs: bug 25478, bug 25825, bug 54626, bug 71202, bug 75657, bug 78264, bug 78574 and probably others too.

as i don't see the right ways to explain this in these bugs, i'm trying to make a summary bug that explains the situation in a more detailed way. sorry if i start _yet_another_konqueror-printing-issue_font_size_bug_ but hopefully this will be fixed and all this related bugs will be closed with this too. 

to the problem:

as far i understand the matters, if you print a website in konqueror, the results depend highly on the following factors: 

1) html/css code (obviously)
2) your printing system config (resolution, ...)
3) your font configuration in konqueror 

point 1 cannot be changed that easily without much manipulation and messing (i know that you can use a custom css in konqueror - but doing so every time is not very helpfull to people who do not understand css - do you need to write css to print a website in konqueror?), point 2 depends on your printing system and is not of importance to us now. 

point 3 should be changed or at least made work differently than it is now (konqueror 3.3.2)

Experiment:
-----------
i have a screen resolution of 135dpi. this i set up correctly in my font configs (xft and x.org). therefore if i see 8pt text somewhere, it is big enough to be seen confortably on the screen. therefore i set up my "Minimal Font Size" (settings -> configure konqueror -> fonts) to 8pt. the "Medium Size" is set to 10pt. 

if i print a website that has no specification on font in my printer, the text is very small (2mm height) and hardly usable. (also in the preview i see the fonts small (=my printer settings are OK)). if i change the "Minimal Font Size" to 10pt and the medium to 12pt, the text comes out with 4mm height.

To have a normally printed document (~6mm text height) i need to have 12pt and 15pt set up in konqueror. Having this set up, it handicaps my browsing, as the text is too big on the screen!

Conclusion:
-----------
Obviously this means that the font specified under "Settings -> Configure Konqueror -> Fonts" also control the size of the printed document.

==> The font size in printed website pages should be handled separately to the screen font sizes.

Possible Solutions:
-------------------
* Specifying a "Standard Printing Font Size" in "Settings -> Configure Konqueror -> Fonts". On this size all printing is based. 
-> This can either mean all texts are in this size (as if someone used custom css to override  the *{fontsize:} setting) 
-> or can be used as the standard font size for printing being the normal font size and relative fontsizes in websites are calculated on this fontsize to be =0. (using absolute fontsizes in websites is depreached and should in most cases not be used anyway)

* having a zoom-factor in the printing dialogue or under "Settings -> Configure Konqueror -> Fonts" that specifies the enlargement or en-smallement of all fonts in the printed website based on the rendered fonts. 

* ...

maybe someone out there has a better suggestion ... these are my suggestions to solve this.
Comment 1 Joseph Reagle 2005-03-16 16:49:10 UTC
Might be related to this long standing bug as well: http://bugs.kde.org/show_bug.cgi?id=100604
Comment 2 Damir Perisa 2005-03-18 10:38:10 UTC
Joseph Reagle: you posted the link of this bug instead of some other in comment 1 - what other bug do you mean?
Comment 3 Damir Perisa 2005-03-18 10:38:48 UTC
*** This bug has been confirmed by popular vote. ***
Comment 4 Joseph Reagle 2005-03-18 15:35:55 UTC
Sorry, I mean this one:
  http://bugs.kde.org/show_bug.cgi?id=54985

"In Konqueror, if you have a page with a very long preformatted <pre> element, the whole page/document is scaled to accomodate that one line. It's a good effort but can render the printout useless. It'd be nice if it tried, but if the page get's scaled greater than 80%, the the line is simply cut off at the margin."
Comment 5 Damir Perisa 2005-03-18 18:54:26 UTC
no problem. you can also simply write the bug number like 54985 and bugzilla will automatically make the link

54985 is related to this, but is a special case. the <pre> element is mostly used for outputting debug-info on websites. if someone uses <pre> in a wrong way, you are always in trouble (the engine (khtml) is not allowed to insert a new-line or CR or LR in a <pre> element. that's the whole point of it. if you need monospaced output in a website, use <tt>)
Comment 6 Andreas Stoehr 2005-04-06 04:47:03 UTC
my screenresolution is 1920x1440 and the screensize is 395mmx295mm. the fontsize of printed website or mail is only 1mm. playing with "Minimal Font Size" has no effect. in kmail i adjust the printfont to 20pt, the result on paper where 3,5mm.
with update to kde3.3.2 the screen is no more comparable to the paper. 
Comment 7 Damir Perisa 2005-04-06 16:45:06 UTC
on comment #6:

check if X knows about your DisplaySize:

Section "Monitor"
        Identifier   "LCD"
        DisplaySize  306 231   # <-- important to be set!
        HorizSync    28-95
        ModelName    "FlexView 1600X1200"
        Option      "dpms"
EndSection

and also check if your font configs contain the dpi-value of your screen:

something like this

         <match target="pattern">
                 <edit name="dpi" mode="assign"><double>132</double></edit>
         </match>

should be somewhere in /etc/fonts/local.conf   

... but i can fully reproduce this behaviour
Comment 8 Andreas Stoehr 2005-04-06 18:14:25 UTC
the DisplaySize was set to the right values and X knows about 123dpi (output from xdpyinfo).
thanks for the hint with fontconfig. i set the dpi to 123, but there is no affect to printout.
Comment 9 Andreas Stoehr 2005-04-06 19:01:46 UTC
Created attachment 10527 [details]
comparison of printprevies

both printpreviews are nearly equal the printout, but konquerors printpreview
is too small.
Comment 10 Andreas Stoehr 2005-04-06 19:03:40 UTC
oh sorry, i make the changes on a different computer as the tests.
the printout is after the changes in fontconfig more readable, but alway too small.
Comment 11 Damir Perisa 2005-04-06 23:59:38 UTC
fontconfig: you're welcome. this line is often forgotten in the fontconfig and then users complain about too big or too small fonts on screen (in general in X)

yes, as you also have seen (and that is also my observation), the print output of khtml is too small, also if the settings are done correctly. 

the main problem is that rendering for printing should not be related to the rendering for displaying. if you print the same website on different machines running the same version of konqueror, the output may look differently (depending on the display-configs/resolutions) - and that's bad
Comment 12 Bjarne Wichmann Petersen 2005-05-02 09:56:17 UTC
I just did an upgrade from KDE 3.3.2 to 3.4 and went from miniscule printout to overbloated printout as reported in bug #100807 as well.

What changed between 3.3.2 and 3.4?
Comment 13 Janet 2005-05-03 22:37:55 UTC
As a non-programmer/just user the solution to all konq print bugs for me seems to be a print preview with an adustable font size which also changes the font size of the current printout.
Comment 14 Pavel Simerda 2005-05-26 18:39:56 UTC
Yes or just at least correct printing... when I set up print size in css as 12pt, i clearly want to print it out as twelve typographical points on the printer... but it's not.
Comment 15 Allan Sandfeld 2005-09-08 23:17:47 UTC
The way the printing system works is by generating postscript at the standard 75DPI resolution, when this is processed by a printer, the text should be automatically scaled up to match the printers native resolution. 

The low 75DPI actually means that px sized fonts are usually larger on print than on screen, but pt sized fonts have the exactly same size.

The only case where this principle is broken are for fixed width webpages. Web-pages that specify width in px are often too wide to fit naturally on paper, and the whole web-page including fonts and then scaled down to fit.
Comment 16 Pavel Simerda 2005-10-09 19:01:23 UTC
I'm not entirely sure of that... I'll have to test again, but I thing it changed the font size even for pt-sized text without any long <pre> lines.
Comment 17 Scott Newton 2005-10-23 04:04:26 UTC
I think what I am seeing is related to this bug. If you go to http://www.idealx.org/prj/samba/smbldap-howto.fr.html and try to preview or print this page then the resulting font is microscopic and compressed to the right. There are no long lines as far as I can see. I've tried saving this page to disk and running it through tidy with various options but none of them fix the previewing/printing issue. It prints correctly from Mozilla Firefox. Also, most other website preview/print correctly from konqueror.
Comment 18 Claus Wilke 2006-01-06 01:32:22 UTC
This bug is still not resolved in KDE 3.5. On my system, to get a printout that is reasonable (not too large), I have to set a font that is too small (for my taste) on screen. All the comments on correct DPI settings etc. are irrelevant. I like large fonts on screen, because they are much easier to read and don't waste any resources, but I want small fonts on printout, because I don't want to waste paper and small fonts are usually still readable on paper.

Why can't konqueror have different font settings for on screen reading and for printing, as several people have asked? That's the way kate works now, and it works great.
Comment 19 Pavel Simerda 2006-02-09 23:49:06 UTC
I agree. Separation of presentation on paper from presentation on screen seems reasonable to me.
Comment 20 Kurt Pfeifle 2007-01-06 02:53:38 UTC
@ scottn@ihug.co.nz (comment #17)

The link to http://www.idealx.org/prj/samba/smbldap-howto.fr.html does no longer seem to provide a test case.

Do you know a replacement?
Comment 21 Trond P. Skjoensberg 2007-01-06 20:38:15 UTC
Kurt Pfeifle wrote:
[bugs.kde.org quoted mail]

As I remember, the problem was totally site- or page independent. The 
font sizes varied by Konqueror's window size before entering ctrl-p.

I am not able to test this now (as I have no access to Linux systems at 
the moment).
Comment 22 Kurt Pfeifle 2007-01-07 18:20:32 UTC
True, Trond, Konqueror needs a way to control the scaling of fonts and images in printouts (Opera f.e. is much better here). Also, it looks like the behaviour has changed a few times in the past (it looks like it now scales all page contents to make images, tables and <pre> lines to fit to the page width, which very often causes unreadably small fonts).
Comment 23 Kurt Pfeifle 2007-01-07 18:25:32 UTC
However, I'm still interested in building a collection of test case sites, which can be used for testing in the future development of code that tackles "image and font size control in printouts"....
Comment 24 Kurt Pfeifle 2007-01-07 18:58:13 UTC
*** Bug 78574 has been marked as a duplicate of this bug. ***
Comment 25 Kurt Pfeifle 2007-01-07 22:10:50 UTC
*** Bug 53189 has been marked as a duplicate of this bug. ***
Comment 26 Kurt Pfeifle 2007-01-08 00:05:33 UTC
*** Bug 100807 has been marked as a duplicate of this bug. ***
Comment 27 Kurt Pfeifle 2007-01-29 17:46:16 UTC
*** Bug 140833 has been marked as a duplicate of this bug. ***
Comment 28 Allan Sandfeld 2011-03-27 20:01:00 UTC
KHTML currently sets the default font-size to 12 when printing. I can easily change this to reading the same setting as used for the screen. I wonder how much sense it makes though, are there any better suggestions?
Comment 29 Claus Wilke 2011-03-28 23:28:42 UTC
12-point font seems to be a better default than screen font size. But ultimately, it should be possible to set the print font size separately from the screen font size.

In a perfect world, I think the best way to do this would be to show a print-preview window with some kind of a zoom button, where I can zoom to the appropriate font size for the specific document before sending it to the printer.
Comment 30 Myriam Schweingruber 2012-06-18 18:00:03 UTC
(In reply to comment #28)
> KHTML currently sets the default font-size to 12 when printing. I can easily
> change this to reading the same setting as used for the screen. I wonder how
> much sense it makes though, are there any better suggestions?

Which version is this about?
Comment 31 Andrew Crouthamel 2018-09-23 02:42:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 32 Andrew Crouthamel 2018-10-27 03:44:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!