How to change arabic font?

hey i want to change my Arabic font i tried to make a conf file in /etc/fonts/conf.d/ that contains this

<?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>Droid Arabic Kufi</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>Droid Arabic Kufi</string>
        </edit>
    </match>
</fontconfig>

in system like file manager and such, i can see the font but in apps like google chrome etc I cant any help?

That’s a support request, while this site is for discussing Ubuntu development. So please check out this page for some suggestions on where to get help.

But with that said I’d like to mention that we recently changed the default font for Arabic. The new font is present in 20.04, 20.10 and the development version. However, the change is only effective under an Arabic locale.

Can’t help wondering if you noticed that change.

He has problem in Snap applications because snap not use system fonts config
That can be solve by merge my PR

https://github.com/ubuntu/snapcraft-desktop-helpers/pull/213

The OP mentioned Google Chrome, which is not provided via a snap AFAIK. (Chromium is OTOH.)

i needed help so i asked here idk man

no, i dont use snap.

Hi @sal
I usually do my customisation like below, just open a terminal, copy the below and hit enter, see if it changes anything, for me it helps Firefox greatly, on any distro, but I don’t use Chrome unfortunately:

mkdir ~/.config/fontconfig/ && cat > ~/.config/fontconfig/fonts.conf << EE
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

    <match target="font" >
        <edit mode="assign" name="autohint" >
            <bool>false</bool>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="rgba" >
            <const>rgb</const>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="hinting" >
            <bool>true</bool>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="hintstyle" >
            <const>hintslight</const>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="antialias" >
            <bool>true</bool>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="lcdfilter" >
            <const>lcddefault</const>
        </edit>
    </match>

    <alias>
        <family>serif</family>
        <prefer>
            <family>Noto Sans Arabic UI</family>
        </prefer>
    </alias>
    <alias>
         <family>sans-serif</family>
         <prefer>
             <family>Noto Sans Arabic UI</family>
         </prefer>
    </alias>
    <alias>
         <family>monospace</family>
         <prefer>
             <family>Noto Sans Arabic UI</family>
         </prefer>
    </alias>

    <alias>
         <family>Arial</family>
         <prefer>
             <family>Noto Sans Arabic UI</family>
         </prefer>
    </alias>

</fontconfig>
EE

If this works, just replace Noto Sans Arabic UI with your font of choice.