Created attachment 2051 [details] messed up text display with 168 dpi Hi, I use a laptop with a display of 168 dpi. The variable Xft.dpi is set to 168 in my ~/.Xdefaults. When viewing the html part of an email the spacing between words and between lines is way too big. Setting Xft.dpi to 96 solves the problem but then the fonts displayed in claws-mail itself but not(!) in the plugin window are too small. Interestingly, the different dpi settings don't effect litehtml's font sizes but only the spacing as you can see in the attached png files. The (separately built) lite browser doesn't have that problem (but then of course that is built using gtk3).
Created attachment 2052 [details] normal display with 96 dpi
Using the newer .Xresources, I can confirm that this happens in GTK3 Claws as well as the GTK2 version. So, GTK3 is not the key to this.
I tried to pinpoint the problem a bit. However, being more of a Qt guy I am not really familiar with gtk, pango, etc. At least I replaced almost all litehmtl files bundled with the plugin with those of the current litehtml files (except for container_linux.{cpp,h} whose newer versions gave me a nightmare when I tried to compile the plugin with them. After a small change in document.h it compiled and was loadable but the problem remained. So I assume that litehtml itself is not to blame. My guess is that the function lh_widget::draw_text in file lh_widget_text.cpp is the culprit as it contains the comment "/* Draw the text where it's supposed to be */". But as I said, I really don't know (and don't have the time to learn) how all this stuff is supposed to play together.
i have the same problem and made a issue on the litehtml github page. (https://github.com/litehtml/litehtml/issues/113) It seems the plugin should adapt the width of litehtml::document_container if dpi is !=96
Hm, how can your observations be the same issue? As I said in my OP I don't see that problem in the litehtml browser but only in the plugin. And for the spacing is too wide whereas in your bug report you have overlapping text. I don't think that your dpi setting is less then 96.
My dpi is 84! (https://www.necdisplay.com/products/displays/lcd1990fxp-bk) When i set dpi to 168 it looks like Jazz Fan's screenshoot.
Ah okay. But obviously you see this bug also in the standalone browser. I don't! That's why I reported the bug here…
fixed in git
*** Bug 4461 has been marked as a duplicate of this bug. ***
(In reply to Paul from comment #8) Thanks Paul, this fixes the spacing. However, now the font sizes are incorrect. I was able to fix that for me in a very inelegant way. Since I know that my scaling factor is 168/96=7/4 I changed all three occurrences of PANGO_SCALE in lh_widget_text.cpp to PANGO_SCALE1 and added #define PANGO_SCALE1 ((PANGO_SCALE*4)/7) on line 25 of that file.
Now that the fix has hit version 3.18 I wanted to say again that the font sizes are still wrong. In simple html mails this just leads to an enlarged display of the text which is not dramatic (and may be the reason that the problem is not spotted immediately). But in complex mails this can be very disturbing. I'll attach two screenshots, one with the litehtml plugin in clawsmail and one after opening the same mail in firefox.
Created attachment 2226 [details] font size too big so lines are touching
Created attachment 2227 [details] Same mail in firefox. Lines do not touch.