#StackBounty: #linux #fonts #fontconfig #deepin Changing font family for characters of a certain language/script using fontconfig?

Bounty: 50

I am on Arch Linux, Deepin Desktop. I am using Noto Serif as my standard font, but I don’t like its Arabic characters. So my goal is to use another font just for arabic characters.

Here is what I have tried. I created a new configuration file in /etc/fonts/conf.d/ with the following contents:

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

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

I then ran fc-cache -r. But this didn’t work, the same font is still in use and running fc-match returns NotoSerif-Regular.ttf: "Noto Serif" "Regular" just as before.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.