[Fontconfig] Problem with font languages in 2.2.90

James Su suzhe at turbolinux.com.cn
Mon Jul 21 11:41:08 EST 2003

The comment of FcLangSetContains () said:

* return FcTrue if lsa contains every language in lsb
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">

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.

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
>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
>        Missing bitmap aa
>Can someone comment on this?  Thanks.
>--- 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 at fontconfig.org

More information about the Fontconfig mailing list