talons

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

commit 8c1a4c98087d84292d4b617af3a9306f6bb2a4b7
parent fe607dfd50a3d9f91cc2a756d41c19a835e27197
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 | 5+++++
Msrc/gtk/authors.h | 1+
Msrc/plugins/litehtml_viewer/lh_widget_text.cpp | 4++++
3 files changed, 10 insertions(+), 0 deletions(-)

diff --git 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 diff --git a/src/gtk/authors.h b/src/gtk/authors.h @@ -304,6 +304,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 */