Hello community,

here is the log from the commit of package gnome-logs for openSUSE:Factory 
checked in at 2016-11-17 12:24:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gnome-logs (Old)
 and      /work/SRC/openSUSE:Factory/.gnome-logs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gnome-logs"

Changes:
--------
--- /work/SRC/openSUSE:Factory/gnome-logs/gnome-logs.changes    2016-10-18 
10:28:03.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gnome-logs.new/gnome-logs.changes       
2016-11-17 12:24:22.000000000 +0100
@@ -1,0 +2,8 @@
+Sun Nov 13 17:06:52 UTC 2016 - badshah...@gmail.com
+
+- Add gnome-logs-css-parsing-error.patch: Fix a css parsing error
+  that caused text in logs to be tiny and no respect accessibility
+  settings; patch taken from upstream git master branch
+  (bgo#768985).
+
+-------------------------------------------------------------------

New:
----
  gnome-logs-css-parsing-error.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gnome-logs.spec ++++++
--- /var/tmp/diff_new_pack.WPZcDN/_old  2016-11-17 12:24:23.000000000 +0100
+++ /var/tmp/diff_new_pack.WPZcDN/_new  2016-11-17 12:24:23.000000000 +0100
@@ -25,6 +25,8 @@
 Group:          System/Utilities
 Url:            https://wiki.gnome.org/Design/Apps/SystemLog
 Source:         
http://download.gnome.org/sources/gnome-logs/3.22/%{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM gnome-logs-css-parsing-error.patch bgo#768985 
badshah...@gmail.com -- Fix a css parsing error that caused text in logs to be 
tiny and no respect accessibility settings; patch taken from upstream git 
master branch
+Patch0:         gnome-logs-css-parsing-error.patch
 BuildRequires:  gtk-doc
 BuildRequires:  hicolor-icon-theme
 BuildRequires:  intltool >= 0.50.0
@@ -43,6 +45,7 @@
 %lang_package
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure

++++++ gnome-logs-css-parsing-error.patch ++++++
>From bcf4307e2e22328c7f9d87df653a78c06f7f6a5a Mon Sep 17 00:00:00 2001
From: Jonathan Kang <jonathan121...@gmail.com>
Date: Mon, 10 Oct 2016 16:43:51 +0800
Subject: Fix CSS parsing error

https://bugzilla.gnome.org/show_bug.cgi?id=768985
---
 src/gl-application.c |  10 ++++-
 src/gl-util.c        | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/gl-util.h        |   1 +
 3 files changed, 133 insertions(+), 2 deletions(-)

diff --git a/src/gl-application.c b/src/gl-application.c
index b4984aa..5919661 100644
--- a/src/gl-application.c
+++ b/src/gl-application.c
@@ -159,12 +159,16 @@ on_monospace_font_name_changed (GSettings *settings,
     {
         GtkCssProvider *provider;
         gchar *css_fragment;
+        gchar *css_desc;
+        PangoFontDescription *font_desc;
 
         g_free (priv->monospace_font);
         priv->monospace_font = font_name;
 
-        css_fragment = g_strconcat (".event-monospace { font: ", font_name,
-                                    "; }", NULL);
+        font_desc = pango_font_description_from_string (font_name);
+        css_desc = pango_font_description_to_css (font_desc);
+        css_fragment = g_strconcat (".event-monospace ", css_desc, NULL);
+
         provider = gtk_css_provider_new ();
         g_signal_connect (provider, "parsing-error",
                           G_CALLBACK (gl_util_on_css_provider_parsing_error),
@@ -175,8 +179,10 @@ on_monospace_font_name_changed (GSettings *settings,
                                                    GTK_STYLE_PROVIDER 
(provider),
                                                    
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 
+        g_free (css_desc);
         g_free (css_fragment);
         g_object_unref (provider);
+        pango_font_description_free (font_desc);
     }
     else
     {
diff --git a/src/gl-util.c b/src/gl-util.c
index e10ff58..eabacf6 100644
--- a/src/gl-util.c
+++ b/src/gl-util.c
@@ -460,3 +460,127 @@ gl_util_can_read_user_journal (void)
         return FALSE;
     }
 }
+
+/**
+ * This function is orignally written in gtk/gtkfontbutton.c of gtk+ project.
+ */
+gchar *
+pango_font_description_to_css (PangoFontDescription *desc)
+{
+  GString *s;
+  PangoFontMask set;
+
+  s = g_string_new ("{ ");
+
+  set = pango_font_description_get_set_fields (desc);
+  if (set & PANGO_FONT_MASK_FAMILY)
+    {
+      g_string_append (s, "font-family: ");
+      g_string_append (s, pango_font_description_get_family (desc));
+      g_string_append (s, "; ");
+    }
+  if (set & PANGO_FONT_MASK_STYLE)
+    {
+      switch (pango_font_description_get_style (desc))
+        {
+        case PANGO_STYLE_NORMAL:
+          g_string_append (s, "font-style: normal; ");
+          break;
+        case PANGO_STYLE_OBLIQUE:
+          g_string_append (s, "font-style: oblique; ");
+          break;
+        case PANGO_STYLE_ITALIC:
+          g_string_append (s, "font-style: italic; ");
+          break;
+        }
+    }
+  if (set & PANGO_FONT_MASK_VARIANT)
+    {
+      switch (pango_font_description_get_variant (desc))
+        {
+        case PANGO_VARIANT_NORMAL:
+          g_string_append (s, "font-variant: normal; ");
+          break;
+        case PANGO_VARIANT_SMALL_CAPS:
+          g_string_append (s, "font-variant: small-caps; ");
+          break;
+        }
+    }
+  if (set & PANGO_FONT_MASK_WEIGHT)
+    {
+      switch (pango_font_description_get_weight (desc))
+        {
+        case PANGO_WEIGHT_THIN:
+          g_string_append (s, "font-weight: 100; ");
+          break;
+        case PANGO_WEIGHT_ULTRALIGHT:
+          g_string_append (s, "font-weight: 200; ");
+          break;
+        case PANGO_WEIGHT_LIGHT:
+        case PANGO_WEIGHT_SEMILIGHT:
+          g_string_append (s, "font-weight: 300; ");
+          break;
+        case PANGO_WEIGHT_BOOK:
+        case PANGO_WEIGHT_NORMAL:
+          g_string_append (s, "font-weight: 400; ");
+          break;
+        case PANGO_WEIGHT_MEDIUM:
+          g_string_append (s, "font-weight: 500; ");
+          break;
+        case PANGO_WEIGHT_SEMIBOLD:
+          g_string_append (s, "font-weight: 600; ");
+          break;
+        case PANGO_WEIGHT_BOLD:
+          g_string_append (s, "font-weight: 700; ");
+          break;
+        case PANGO_WEIGHT_ULTRABOLD:
+          g_string_append (s, "font-weight: 800; ");
+          break;
+        case PANGO_WEIGHT_HEAVY:
+        case PANGO_WEIGHT_ULTRAHEAVY:
+          g_string_append (s, "font-weight: 900; ");
+          break;
+        }
+    }
+  if (set & PANGO_FONT_MASK_STRETCH)
+    {
+      switch (pango_font_description_get_stretch (desc))
+        {
+        case PANGO_STRETCH_ULTRA_CONDENSED:
+          g_string_append (s, "font-stretch: ultra-condensed; ");
+          break;
+        case PANGO_STRETCH_EXTRA_CONDENSED:
+          g_string_append (s, "font-stretch: extra-condensed; ");
+          break;
+        case PANGO_STRETCH_CONDENSED:
+          g_string_append (s, "font-stretch: condensed; ");
+          break;
+        case PANGO_STRETCH_SEMI_CONDENSED:
+          g_string_append (s, "font-stretch: semi-condensed; ");
+          break;
+        case PANGO_STRETCH_NORMAL:
+          g_string_append (s, "font-stretch: normal; ");
+          break;
+        case PANGO_STRETCH_SEMI_EXPANDED:
+          g_string_append (s, "font-stretch: semi-expanded; ");
+          break;
+        case PANGO_STRETCH_EXPANDED:
+          g_string_append (s, "font-stretch: expanded; ");
+          break;
+        case PANGO_STRETCH_EXTRA_EXPANDED:
+          g_string_append (s, "font-stretch: extra-expanded; ");
+          break;
+        case PANGO_STRETCH_ULTRA_EXPANDED:
+          g_string_append (s, "font-stretch: ultra-expanded; ");
+          break;
+        }
+    }
+  if (set & PANGO_FONT_MASK_SIZE)
+    {
+      g_string_append_printf (s, "font-size: %dpt", 
pango_font_description_get_size (desc) / PANGO_SCALE);
+    }
+
+  g_string_append (s, "}");
+
+  return g_string_free (s, FALSE);
+}
diff --git a/src/gl-util.h b/src/gl-util.h
index 1b1c6ac..2cdcee8 100644
--- a/src/gl-util.h
+++ b/src/gl-util.h
@@ -65,6 +65,7 @@ gchar * gl_util_boot_time_to_display (guint64 timestamp_first,
 GlJournalStorage gl_util_journal_storage_type (void);
 gboolean gl_util_can_read_system_journal (GlJournalStorage storage_type);
 gboolean gl_util_can_read_user_journal (void);
+gchar *pango_font_description_to_css (PangoFontDescription *desc);
 
 G_END_DECLS
 
-- 
cgit v0.12


Reply via email to