[Fontconfig] FcPattern Gotcha

Akira TAGOH akira at tagoh.org
Fri Dec 2 03:27:50 UTC 2016

Please use the latest one. that should be fixed in 2.12.0 and later.


and some  minor fixes after that too (just FYI if you want to cherry-pick
it for backport or so)

On Fri, Dec 2, 2016 at 10:09 AM, Lawrence D'Oliveiro <
ldo at geek-central.gen.nz> wrote:

> On Tue, 29 Nov 2016 16:30:35 +0900, Akira TAGOH wrote:
> > Can you attach the example that can reproduce your issue?
> >
> > FcNameParse() should generates the same FcPattern with the strings
> > generated by FcNameUnparse().
> OK, I have narrowed it down. Attached is the simplest C program I could
> come up with to demonstrate the issue. Pass it a pattern string on the
> command line, e.g.
>     fc_pattern_2 sans-serif
> and it will print out some information about what it found. Having
> found a matching pattern, it calls FcNameUnparse to convert that to a
> pattern string, followed by FcNameParse to convert the string back to a
> pattern.
> If the pattern includes the “charset” property, the FcNameParse call
> fails, possibly even segfaults. Removing this property causes the parse
> (and the subsequent match) to succeed. I helpfully put the call
> “FcPatternDel(found_pat, FC_CHARSET);” inside an “if (true)” block, so
> you can try changing it to “if (false)” to observe the effect.
> I have libconfig 2.11.0 installed from the repo package on Debian
> Unstable.
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20161202/55a975c9/attachment.html>

More information about the Fontconfig mailing list