特定の言語のデフォルトフォントを変更する

特定の言語のデフォルトフォントを変更する

ペルシア語/ペルシア語などの特定の言語のデフォルトのフォントを変更する方法はありますか? フォント システム全体を変更したくはありません。Ubuntu フォントはとても気に入っていますが、ペルシア語/ペルシア語バージョンは非常に悪く、読みにくいです。Unity Tweak Tool をインストールしましたが、特定の言語/フォント ファミリーのフォントを変更するオプションは提供されていません。

ご協力いただければ幸いです。よろしくお願いします。OS: Ubuntu 14.10

答え1

ファイルを作成し~/.config/fontconfig/conf.d/90-my-farsi.conf、スターターとして次の内容を指定できます。

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test name="lang" compare="contains">
            <string>fa</string>
        </test>
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Homa</string>
        </edit>
    </match>

    <match target="pattern">
        <test name="lang" compare="contains">
            <string>fa</string>
        </test>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Homa</string>
        </edit>
    </match>
</fontconfig>

このファイルにより、ペルシア語が選択された言語の場合、Homa フォント (fonts-farsiweb パッケージに含まれています) が最初に選択されるようになります。

$ LANG=fa_IR fc-match
homa.ttf: "Homa" "Regular"
$ 

関連情報