- Install the font
sudo apt install fonts-vazirmatn
or download it and place it in ~/.local/share/fonts/
or /usr/share/fonts/truetype/
.
- Create this file
mkdir -p ~/.config/fontconfig
nano ~/.config/fontconfig/fonts.conf
- Paste this in it
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Prefer Vazirmatn for sans-serif -->
<match>
<test name="family" compare="eq">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazirmatn</string>
</edit>
</match>
<!-- Force Persian (fa) language to use Vazirmatn -->
<match>
<test name="lang" compare="contains">
<string>fa</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazirmatn</string>
</edit>
</match>
</fontconfig>
- Reload
fc-cache -f -v