[gtk/demo-polish: 1/5] gtk-demo: Follow font settings again




commit 2a3d3ec07955bf1f29647f1f11acf5eb72a5e695
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 8 23:38:07 2020 -0400

    gtk-demo: Follow font settings again
    
    highlight puts font and size information into
    its pango markup; strip that out to make our
    text follow font settings again.

 demos/gtk-demo/main.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index d3f65220d0..668f3e2d11 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -328,8 +328,13 @@ fontify (const char    *format,
     {
       char *markup;
       gsize len;
+      char *p;
 
       markup = g_bytes_unref_to_data (bytes, &len);
+      /* highlight puts a span with font and size around its output,
+       * which we don't want.
+       */
+      for (p = markup + strlen ("<span "); *p != '>'; p++) *p = ' ';
       gtk_text_buffer_delete (source_buffer, &start, &end);
       gtk_text_buffer_insert_markup (source_buffer, &start, markup, len);
       g_free (markup);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]