Hi,
The comment of FcLangSetContains () said:
/*
* return FcTrue if lsa contains every language in lsb
*/
FcBool
FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb)
{
...
So I think the original call FcLangSetContains (m.u.l, v.u.l); is ok.
Because the parameter m.u.l is the langsets supported by a font, and
v.u.l is a langset specified by user. For example if you wrote the
following configuration in fonts.conf:
<match target="font">
<test name="lang" compare="contains">
<string>ja</string>
</test>
...
</match>
then when calling FcLangSetContains within fccfg.c, the v.u.l will equal
to ja, and the m.u.l will be the supported langsets of the matching
font. So if a font supports many langsets including ja, the match will
be true. But if you invert the two parameters, this configuration block
will always be false. Because a ja langset can never contain many
langsets. That''s not right.
Regards
James Su
Joe Marcus Clarke wrote:
>I upgraded to 2.2.90, and I noticed that most Mozilla-based browsers no
>longer have any fonts for Western encoding. When I looked at the
>fontconfig code, it looks like FcLangSetContains() is being called with
>arguments in the wrong order from fccfg.c. Based on the comments
>preceding the FcLangSetContains() declaration, I think the original
>order of the arguments in fccfg.c were correct. The attached patch
>seems to correct the problem. This is what I was seeing in the debug in
>2.2.1:
>
>FcLangSet
>aa|ab|af|am|ar|ast|ava|ay|az|ba|bam|be|bg|bh|bho|bi|bin|br|bs|bua|ca|ce|ch|chm|chr|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|ful|fur|fy|ga|gd|gez|gl|gn|gv|ha|haw|he|hi|ho|hr|hu|hy|ia|ibo|id|ie|ik|io|is|it|iu|ka|kaa|ki|kk|kl|kok|ks|ku|kum|kv|kw|ky|la|lb|lez|lo|lt|lv|mg|mh|mi|mk|mo|mr|mt|nb|ne|nl|nn|no|ny|oc|om|os|pl|pt|rm|ro|ru|sa|sah|sco|se|sel|sh|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|sv|sw|tg|th|tig|tk|tn|to|tr|ts|tt|tw|tyv|ug|uk|ur|uz|ven|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu
contains en
>
>This is what I see in 2.2.90 without the patch:
>FcLangSet en contains
>aa|ab|af|am|ar|ast|ava|ay|az|ba|bam|be|bg|bh|bho|bi|bin|br|bs|bua|ca|ce|ch|chm|chr|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|ful|fur|fy|ga|gd|gez|gl|gn|gv|ha|haw|he|hi|ho|hr|hu|hy|ia|ibo|id|ie|ik|io|is|it|iu|ka|kaa|ki|kk|kl|kok|ks|ku|kum|kv|kw|ky|la|lb|lez|lo|lt|lv|mg|mh|mi|mk|mo|mr|mt|nb|ne|nl|nn|no|ny|oc|om|os|pl|pt|rm|ro|ru|sa|sah|sco|se|sel|sh|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|sv|sw|tg|th|tig|tk|tn|to|tr|ts|tt|tw|tyv|ug|uk|ur|uz|ven|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu
> Missing bitmap aa
>
>Can someone comment on this? Thanks.
>
>Joe
>
>
>
>------------------------------------------------------------------------
>
>--- src/fccfg.c.orig Fri Jul 18 15:22:21 2003
>+++ src/fccfg.c Fri Jul 18 15:20:03 2003
>@@ -617,10 +617,10 @@
> case FcTypeLangSet:
> switch (op) {
> case FcOpContains:
>- ret = FcLangSetContains (m.u.l, v.u.l);
>+ ret = FcLangSetContains (v.u.l, m.u.l);
> break;
> case FcOpNotContains:
>- ret = FcLangSetContains (m.u.l, v.u.l);
>+ ret = FcLangSetContains (v.u.l, m.u.l);
> break;
> case FcOpEqual:
> ret = FcLangSetEqual (m.u.l, v.u.l);
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Fontconfig mailing list
>Fontconfig@fontconfig.org
>http://mail.fontconfig.org/mailman/listinfo/fontconfig
>
>
Around 15 o''clock on Jul 18, Joe Marcus Clarke wrote:> I upgraded to 2.2.90, and I noticed that most Mozilla-based browsers no > longer have any fonts for Western encoding.Yeah, it''s broken and I posted a description of the problem a few days ago. It''s "hard" to get right, but I think the semantics I describe here: http://mail.fontconfig.org/pipermail/fontconfig/2003-July/000528.html are what we want. I won''t have time to look at this until the middle of august(!) because of OLS and vacation, but anyone else would be welcome to help out here... -keith
Please go back and read the message I posted a few days ago about this issue: http://keithp.com/pipermail/fontconfig/2003-July/000528.html The problem is that you want both: en "contains" en_gb and zh_cn "contains" zh That way you can list both ''English fonts for Great Britian'' and ''Chinese Fonts, regardless of territory''. If we get some experience that this semantic is correct, I can back-port that part of the recent change (leaving out the other changes in Listing semantics) to the 2.2 branch. So, we need some reports indicating that this is a good change... -keith
Joe Marcus Clarke
2005-Nov-21 08:50 UTC
[Fontconfig] Problem with font languages in 2.2.90
Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: This is a digitally signed message part Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20030718/9d037dd6/attachment.pgp