Re: FcPattern Gotcha

Akira TAGOH <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <CACT-Cx2aUzu-m845MeHP3TeQ+YyKfR2awhGFPBuz2RaBqeBs=w@mail.gmail.com>
Please use the latest one. that should be fixed in 2.12.0 and later.

https://cgit.freedesktop.org/fontconfig/commit/?id=e708e97c351d3bc9f7030ef22ac2f007d5114730

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 <
[email protected]> 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
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/fontconfig
>
>


-- 
Akira TAGOH

_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
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.