Re: improvement of font selection



On Tue, 28 Mar 2006, Kenichi Handa wrote:

> Ah!  You are right.  I was short sight.  I was only thinking
> about adding fonts in this kind of parts.
>
> <!--
>   Serif faces
>  -->
> 	<alias>
> 		<family>Bitstream Vera Serif</family>
> 		<family>Times New Roman</family>
> [...]
> 	</alias>
>
> So, I tried this setting to prefer lklug to freeserif for
> sinhara.
>
>         <match>
>                 <test name="lang">
>                         <string>si</string>
>                 </test>
>                 <edit name="family" mode="prepend" binding="same">
>                         <string>lklug</string>
>                 </edit>
>         </match>
>
> Then, fc-match surely returns lklug for :lang=si.  But when
> I open a Sinhala file with gedit, it seems that gedit (or
> pango; I don't know) prefer freeserif over lklug.  The file
> contains this character sequence ("hello" in Sinhara):
>
>   U+0D86 U+0DBA U+0DD4 U+0DB6 U+0DDD U+0DC0 U+0DB1 U+0DCA
>
> The fonts selected are these (I got this information by
> adding printf() in pango/modules/indic/indic-fc.c).
>
>   U+0D86 -> LKLUG
>   U+0DBA U+0DD4 U+0DB6 -> FreeSerif
>   U+0DDD -> LKLUG
>   U+0DC0 U+0DB1 U+0DCA -> FreeSerif
>
> lklug contains all corresponding glyphs, but glyphs for
> U+0D86 and U+0DDD are missing in freeserif.  Of course the
> resulting rendering is incorrect.

This doesn't look good.  Can you put a FcPatternPrint in
pango/pangofc-fontmap.c just before the FcFontSort call to print
out the pattern, and then see what pattern is searched for when
you open the Sinhala text in gedit?  It should have lang=si.  You
are using latest Pango, right?  Not that it makes any different,
just to make sure we are looking at the same code.


--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
	-- Dan Bern, "New American Language"



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