Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/hexchat.git#1958b642ce255e92013559898fbfeb591524326c
This commit is contained in:
DistroBaker 2021-02-06 17:53:30 +00:00
parent ad4821783b
commit 69343412de
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 163608d7fd861c2c4911a38f45be484c88626bdc Mon Sep 17 00:00:00 2001
From: John Levon <levon@movementarian.org>
Date: Mon, 7 Sep 2020 17:53:31 +0100
Subject: [PATCH] Use pango_font_metrics_get_height() to calculate font height
(#2500)
---
src/fe-gtk/xtext.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index fac0c4e6d..418bb4da5 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);

View File

@ -3,7 +3,7 @@
Summary: A popular and easy to use graphical IRC (chat) client
Name: hexchat
Version: 2.14.3
Release: 10%{?dist}
Release: 11%{?dist}
License: GPLv2+
URL: https://hexchat.github.io
Source: https://dl.hexchat.net/hexchat/%{name}-%{version}.tar.xz
@ -11,6 +11,7 @@ Source: https://dl.hexchat.net/hexchat/%{name}-%{version}.tar.xz
# Patch to link better to python 3.8
Patch1: https://github.com/hexchat/hexchat/commit/5deb69591992d4fede9090b60d3dc847612a4d60.patch
Patch2: python-plugin-from-master.patch
Patch3: https://github.com/hexchat/hexchat/commit/163608d7fd861c2c4911a38f45be484c88626bdc.patch
BuildRequires: gcc
BuildRequires: meson
@ -79,6 +80,9 @@ This package contains the development files for %{name}.
%{_libdir}/pkgconfig/hexchat-plugin.pc
%changelog
* Sat Feb 06 2021 Mikel Olasagasti Uranga <mikel@olasagasti.info> - 2.14.3-11
- Include patch to fix underscore not being printed correctly
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.14.3-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild