In this short guide, you will be referenced to installation of two typefaces and configuring fontconfig to use them system wide.
You can find the Vazir Typeface in here: Github Repository
Cantarell Typeface is included in your distro's packages, just lookup the package name and install it
Create a file, with the name .fonts.conf
in your home directory and then populate that file with the following lines.
you can also create a file with your desired name in the ~.config/fontconfig/
directory with .conf
extension.
After doing this, Just log out of your user and login again, there you should see the font changes.
If the fonts are not looking as they should, maybe the fallback fonts are being used, then checking if the fonts are listed as installed in the font utility and wether if the names in the config file are correct.
For more details, Such as advanced configuration, alternative configuration paths etc. have a look at the Fontconfig Documentation in Freedesktop.org
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cantarell</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cantarell</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cantarell</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>fa</string>
</test>
<test qual="any" name="family">
<string>standard</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazir</string>
</edit>
</match>
<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>Vazir</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>Vazir</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>az</string>
</test>
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazir</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>az</string>
</test>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazir</string>
</edit>
</match>
<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>Vazir</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>Vazir</string>
</edit>
</match>
</fontconfig>