"charset=" in trace file cause FcNameParse return NULL

Xi Yang <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAG2O1R0+u4cdoMLT9RrPw1LQ4JwMXi3T_2qxzxyr8s5Rd5-zuw@mail.gmail.com>
Hi,

cairo-perf-trace is not working on my machine (ubuntu 14.04, x86-64).

It looks like the problem is that FcNameParse is not happy with long
"charset= " substring. After cut it off, cairo-perf-trace works fine.

Does it mean that my fontconfig has problems? I attached the patch.


Regards.


diff --git a/util/cairo-script/cairo-script-operators.c
b/util/cairo-script/cairo-script-operators.c
index d4af312..4bc23be 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -1925,6 +1925,7 @@ _ft_create_for_pattern (csi_t *ctx,
     csi_status_t status;
     struct mmap_vec vec;
     void *bytes;
+    char *s;

     _csi_blob_init (&tmpl, (uint8_t *) string->string, string->len);
     _csi_blob_hash (&tmpl, (uint32_t *) string->string, string->len /
sizeof (uint32_t));
@@ -1944,7 +1945,9 @@ _ft_create_for_pattern (csi_t *ctx,
     } else {
     bytes = tmpl.bytes;
     }
-
+    s = strstr((char *)bytes, ":charset");
+    if (s != NULL)
+    *s = '\0';
     pattern = FcNameParse (bytes);
     if (bytes != tmpl.bytes)
     _csi_free (ctx, bytes);
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.