summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-07-14 15:54:38 -0400
committerBehdad Esfahbod <behdad@behdad.org>2014-07-14 15:55:12 -0400
commitf4dbba26d4fc571e0621f3c7a98196c501f8bcc5 (patch)
treec292c042d4e914ee82452902e4734a7e0c0c05e6 /util
parent2a37cbbabc00c7474be5baa25f848778b1773b2c (diff)
[cairo-trace] Work around fontconfig :charset= parse format change
As dicussed on the mailing list.
Diffstat (limited to 'util')
-rw-r--r--util/cairo-script/cairo-script-operators.c12
1 files changed, 12 insertions, 0 deletions
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);