From f4dbba26d4fc571e0621f3c7a98196c501f8bcc5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 14 Jul 2014 15:54:38 -0400 Subject: [cairo-trace] Work around fontconfig :charset= parse format change As dicussed on the mailing list. --- util/cairo-script/cairo-script-operators.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c index d4af3126e..0d6cafc37 100644 --- a/util/cairo-script/cairo-script-operators.c +++ b/util/cairo-script/cairo-script-operators.c @@ -1946,6 +1946,18 @@ _ft_create_for_pattern (csi_t *ctx, } pattern = FcNameParse (bytes); + if (!pattern) + { + /* Fontconfig's representation of charset changed mid 2014; + * We used to record charset before that. Remove everything + * after charset if that's present, and try again. */ + char *s = strstr ((char *) bytes, ":charset="); + if (s) + { + *s = '\0'; + pattern = FcNameParse (bytes); + } + } if (bytes != tmpl.bytes) _csi_free (ctx, bytes); -- cgit v1.2.3