Re: improvement of font selection



On Mon, 27 Mar 2006, Kenichi Handa wrote:

> Unfortunately, AFAIK, fonts.conf doesn't allow per-script
> (or per-language) settings, and we can't say some font is
> broken or not without specifying a script or language.

I keep hearing this (this is the third time in the past couple of
months), but I don't believe it's true.  For example, I just
hacked a tiny fonts.conf to change font selection for Arabic and
Persian.

Before:

[behdad home ~]$ fc-match :lang=fa
roya.ttf: "Roya" "Regular"
[behdad home ~]$ fc-match :lang=ar
roya.ttf: "Roya" "Regular"

After adding this to ~/.fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <match>
                <test name="lang">
                        <string>ar</string>
                </test>
                <edit name="family" mode="prepend" binding="same">
                        <string>Homa</string>
                </edit>
        </match>
</fontconfig>

[behdad home ~]$ fc-match :lang=fa
roya.ttf: "Roya" "Regular"
[behdad home ~]$ fc-match :lang=ar
homa.ttf: "Homa" "Regular"



So, you have per-language configuration.  Per-script may be a bit
harder.  It may be worth adding script support to fontconfig.
Anyway, combining the language test with rejectfont allows for
per-language blacklisting.

--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]