talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 463ae3621f682349102984ee60ee75cd2c62d0b7
parent 40931bb8e5ffec5fd3ece6afe96ffdb508c471a5
Author: paul <paul@claws-mail.org>
Date:   Wed, 17 Mar 2021 15:10:30 +0000

fix bug 4326 'Xft.dpi != 96 messes with text display in litehtml viewer'

patch by Ramin Yaghoubzadeh Torky

Diffstat:
MAUTHORS | 1+
Msrc/gtk/authors.h | 1+
Msrc/plugins/litehtml_viewer/lh_widget_text.cpp | 4++++
3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -335,3 +335,4 @@ contributors (in addition to the above; based on Changelog) Alvar Penning Orivej Desh Steve Randall + Ramin Yaghoubzadeh Torky diff --git a/src/gtk/authors.h b/src/gtk/authors.h @@ -307,6 +307,7 @@ static char *CONTRIBS_LIST[] = { "Masahiro Tomita", "Tomita", "Topia", +"Ramin Yaghoubzadeh Torky", "Anders Troback", "Tsutsui", "Aleksandar Urošević", diff --git a/src/plugins/litehtml_viewer/lh_widget_text.cpp b/src/plugins/litehtml_viewer/lh_widget_text.cpp @@ -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 */