[arch-commits] Commit in hexchat/trunk (2 files)

Christian Hesse eworm at archlinux.org
Fri Jan 1 20:20:43 UTC 2021


    Date: Friday, January 1, 2021 @ 20:20:42
  Author: eworm
Revision: 802852

upgpkg: hexchat 2.14.3-6: fix font rendering with recent pango

Added:
  hexchat/trunk/0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch
Modified:
  hexchat/trunk/PKGBUILD

-----------------------------------------------------------------------+
 0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch |   44 ++++++++++
 PKGBUILD                                                              |    9 +-
 2 files changed, 50 insertions(+), 3 deletions(-)

Added: 0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch
===================================================================
--- 0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch	                        (rev 0)
+++ 0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch	2021-01-01 20:20:42 UTC (rev 802852)
@@ -0,0 +1,44 @@
+commit 163608d7fd861c2c4911a38f45be484c88626bdc
+Author: John Levon <levon at movementarian.org>
+Date:   Mon Sep 7 17:53:31 2020 +0100
+
+    Use pango_font_metrics_get_height() to calculate font height (#2500)
+
+diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
+index fac0c4e6..418bb4da 100644
+--- a/src/fe-gtk/xtext.c
++++ b/src/fe-gtk/xtext.c
+@@ -283,8 +283,24 @@ backend_font_open (GtkXText *xtext, char *name)
+ 	metrics = pango_context_get_metrics (context, xtext->font->font, lang);
+ 	xtext->font->ascent = pango_font_metrics_get_ascent (metrics) / PANGO_SCALE;
+ 	xtext->font->descent = pango_font_metrics_get_descent (metrics) / PANGO_SCALE;
++
++	/*
++	 * In later versions of pango, a font's height should be calculated like
++	 * this to account for line gap; a typical symptom of not doing so is
++	 * cutting off the underscore on some fonts.
++	 */
++#if PANGO_VERSION_CHECK(1, 44, 0)
++	xtext->fontsize = pango_font_metrics_get_height (metrics) / PANGO_SCALE + 1;
++
++	if (xtext->fontsize == 0)
++		xtext->fontsize = xtext->font->ascent + xtext->font->descent;
++#else
++	xtext->fontsize = xtext->font->ascent + xtext->font->descent;
++#endif
++
+ 	pango_font_metrics_unref (metrics);
+ }
++
+ static int
+ backend_get_text_width_emph (GtkXText *xtext, guchar *str, int len, int emphasis)
+ {
+@@ -3479,8 +3495,6 @@ gtk_xtext_set_font (GtkXText *xtext, char *name)
+ 	if (xtext->font == NULL)
+ 		return FALSE;
+ 
+-	xtext->fontsize = xtext->font->ascent + xtext->font->descent;
+-
+ 	{
+ 		char *time_str;
+ 		int stamp_size = xtext_get_stamp_str (time(0), &time_str);

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-01-01 20:05:21 UTC (rev 802851)
+++ PKGBUILD	2021-01-01 20:20:42 UTC (rev 802852)
@@ -3,7 +3,7 @@
 
 pkgname=hexchat
 pkgver=2.14.3
-pkgrel=5
+pkgrel=6
 pkgdesc='A popular and easy to use graphical IRC (chat) client'
 arch=('x86_64')
 url='https://hexchat.github.io/'
@@ -18,15 +18,18 @@
             'python-cffi: Python plugin')
 source=("git+https://github.com/hexchat/hexchat.git#tag=v${pkgver}"
         '0001-python-cffi.patch'
-        '0002-python-3-8.patch')
+        '0002-python-3-8.patch'
+        '0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch')
 sha256sums=('SKIP'
             '92af0d106627c9b9716036ce81f697de35f37b4ba2e7bd34244824520e485bba'
-            '8d17ce657e744272815b5fb33d8ad959f79ece3294349637eaadcf86d90496fa')
+            '8d17ce657e744272815b5fb33d8ad959f79ece3294349637eaadcf86d90496fa'
+            '691f344479a8b1186008516f0ebe7e3d482059cd297f58573634fa5a58f3d0ca')
 
 prepare() {
   cd hexchat
   patch -Np1 < ../0001-python-cffi.patch
   patch -Np1 < ../0002-python-3-8.patch
+  patch -Np1 < ../0003-Use-pango_font_metrics_get_height-to-calculate-font-height.patch
 }
 
 build() {



More information about the arch-commits mailing list