FcCharSetIsSubset(cs1, cs2) sometimes returns true even if cs1 is not a subset of cs2. This causes FcFontSort (with parameter `trim' set to true) to return fewer fonts than it should, and Pango to draw some characters as `unknown characters' (squares with character codes written inside) when it should not. It is always reproducible with Fontconfig 2.1 and 2.1.92 on my environment. I have not tried CVS versions of Fontconfig. I will post sample code shortly.
Created attachment 33 [details] Sample program written in C to reproduce problem
Can you provide a pair of fonts which cause the test to fail?
Now I will :) The result: > ./attachment33 [details] 'Kochi Mincho' 'Charter' cs1 has the character. cs2 does not have the character. FcCharSetIsSubset says cs1 is a subset of cs2. Here, Kochi Mincho is a Japanese TrueType font and Charter is an English non-TrueType font. The first two lines of the result shows correctly that Kochi Mincho contains the character U+65E5 (a CJK unified ideograph) and that Charter does not. FcCharSetIsSubset should return false, but actually it returns true.
Can you test the following patch? Index: fccharset.c =================================================================== RCS file: /local/src/CVS/fontconfig/src/fccharset.c,v retrieving revision 1.21 diff -u -r1.21 fccharset.c --- fccharset.c 5 Mar 2003 05:51:27 -0000 1.21 +++ fccharset.c 18 Mar 2003 07:45:23 -0000 @@ -637,7 +637,7 @@ bi++; } } - return FcTrue; + return ai >= a->num; } /*
Seems to fix the problem. Thank you for your rapid reply!
Thanks for the test case; that's the fastest way to a fix...
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.