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.
This commit is contained in:
Matthias Clasen 2020-08-08 23:38:07 -04:00
parent c60fba0267
commit 2a3d3ec079

View File

@ -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);