From ba21a3cb8f70566aac1cc3f5ed63a2d81c609630 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Sun, 25 Aug 2019 18:43:46 +0300 Subject: Don't depend on glib 2.60 symbols at runtime The G_TYPE_UNICODE_STRING type was added in 2.60, which broke applications using older glib versions (such as matlab). The only usecase was a warning message anyway, so we just avoid using it. --- pango/pango-context.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pango/pango-context.c b/pango/pango-context.c index 99fa454a..a64eb79f 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -1488,17 +1488,19 @@ itemize_state_process_run (ItemizeState *state) { /* If no font was found, warn once per fontmap/script pair */ PangoFontMap *fontmap = state->context->font_map; - const char *script_name = g_enum_to_string (G_TYPE_UNICODE_SCRIPT, state->script); + char *script_tag = g_strdup_printf ("g-unicode-script-%d", state->script); - if (!g_object_get_data (G_OBJECT (fontmap), script_name)) + if (!g_object_get_data (G_OBJECT (fontmap), script_tag)) { - g_warning ("failed to choose a font, expect ugly output. script='%s'", - script_name); + g_warning ("failed to choose a font, expect ugly output. script='%d'", + state->script); - g_object_set_data_full (G_OBJECT (fontmap), script_name, + g_object_set_data_full (G_OBJECT (fontmap), script_tag, GINT_TO_POINTER (1), NULL); } + g_free (script_tag); + font = NULL; } itemize_state_fill_font (state, font); -- cgit v1.2.1