Re: Strange behaviour of fc-match of fontconfig current cvs (2.3.93).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Lam <plam@xxxxxxx> さんは書きました:

> I've committed this patch.  I hope it's alright; I couldn't see anything
> wrong with it.  If I understand correctly, the crux of the correctness
> issue is the change of
>
> 	score += v2_best_score;
>
> to
>
> 	v = score;
>
> (which would be score = v2_best_score in the old code).
>
> and the rest is a performance optimization.  Is that right?  Could
> someone verify that this change alone fixes the bug?

I cannot find exactly the two lines you mention above.

There is a similar part in Zhe Su's patch though which I have attached
here.

Applying *only* this part does *not* solve the problem, actually
it makes it worse:

mfabian@magellan:/var/tmp/abuild/x86_64$ LC_ALL=zh_CN.UTF-8 fc-match 方正楷体
ethio24f-uni.bdf: "ethio24f-uni" "Regular"
mfabian@magellan:/var/tmp/abuild/x86_64$ LC_ALL=zh_CN.UTF-8 fc-match FZSongTi
ethio24f-uni.bdf: "ethio24f-uni" "Regular"
mfabian@magellan:/var/tmp/abuild/x86_64$ LANG=ja_JP.UTF-8 fc-match sans
ethio24f-uni.bdf: "ethio24f-uni" "Regular"

Zhe Su's complete patch does really solve the problem though.

diff -ru fontconfig-2.3.93.20060105.orig/src/fcmatch.c fontconfig-2.3.93.20060105/src/fcmatch.c
--- fontconfig-2.3.93.20060105.orig/src/fcmatch.c	2005-11-30 11:03:18.000000000 +0100
+++ fontconfig-2.3.93.20060105/src/fcmatch.c	2006-01-09 12:52:32.000000000 +0100
@@ -640,10 +640,9 @@
 				/* I'm actually kind of surprised that
 				 * this isn't v + 100 * v1_offset. -PL */
 				v = v * 100 + v1_offset;
-				if (v < v2_best_score)
-				    v2_best_score = v;
+				if (v < score)
+				    score = v;
 			    }
-			    score += v2_best_score;
 			}
 		    }
 
-- 
Mike FABIAN   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux