fix bug 4326 'Xft.dpi != 96 messes with text display in litehtml viewer'
authorpaul <paul@claws-mail.org>
Wed, 17 Mar 2021 15:10:30 +0000 (15:10 +0000)
committerPaul <paul@claws-mail.org>
Wed, 17 Mar 2021 15:14:02 +0000 (15:14 +0000)
patch by Ramin Yaghoubzadeh Torky

AUTHORS
src/gtk/authors.h
src/plugins/litehtml_viewer/lh_widget_text.cpp

diff --git a/AUTHORS b/AUTHORS
index f52bcaf31177955b84c559c94723cfa65c0a5e92..478d93a1c471536f6f2eca7c946980cf9304128f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -332,3 +332,8 @@ contributors (in addition to the above; based on Changelog)
        Jean Delvare
        Damian Poddebniak
        Alvar Penning
+<<<<<<< HEAD
+=======
+       Orivej Desh
+       Steve Randall
+       Ramin Yaghoubzadeh Torky
index 95ea5580f57c94f889b65adb9f898b8f391431f2..4ddf79509b4ccd1250285ae973eaec2a52def4c6 100644 (file)
@@ -304,6 +304,7 @@ static char *CONTRIBS_LIST[] = {
 "Masahiro Tomita",
 "Tomita",
 "Topia",
+"Ramin Yaghoubzadeh Torky",
 "Anders Troback",
 "Tsutsui",
 "Aleksandar Urošević",
index ed290559fd0da06ca59c5530ca41757eea7fdaf1..a832700fca774f1a018efdad092a3a0d409e0982 100644 (file)
@@ -100,6 +100,10 @@ void lh_widget::draw_text( litehtml::uint_ptr hdc, const litehtml::tchar_t* text
        cairo_t *cr = (cairo_t *)hdc;
        PangoLayout *layout = pango_cairo_create_layout(cr);
        PangoContext *context = pango_layout_get_context(layout);
+       GdkScreen* screen = gdk_screen_get_default();
+       double dpi = gdk_screen_get_resolution(screen);
+
+       pango_cairo_context_set_resolution(context, dpi);
 
        if (fnt != NULL) {
                /* Set font */