Skip to content

Instantly share code, notes, and snippets.

@matinrco
Last active February 4, 2023 20:38
Show Gist options
  • Save matinrco/ef59b20b595d3ec8135f9a25084ab642 to your computer and use it in GitHub Desktop.
Save matinrco/ef59b20b595d3ec8135f9a25084ab642 to your computer and use it in GitHub Desktop.

This is fedora persian font fix configuration.


For unknown reasons google droid sans font takes higher precedence in fontconfig instead of default dejavu sans which has better font face for persian and it's default sans-serif font in fedora.
This happens mostly in kde desktop because of using noto fonts as a default option in desktop environment which has no support for persian glyphs then droid font used as fallback font.
You cannot delete droid fonts because of many packages are depend on it.
To fix this we are going to black list droid arabic kufi to force using dejavu sans.
So create or update $HOME/.config/fontconfig/fonts.conf with the following content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
    <selectfont>
        <rejectfont>
            <pattern>
                <patelt name="family">
                    <string>Droid Arabic Kufi</string>
                </patelt>
            </pattern>
        </rejectfont>
    </selectfont>
</fontconfig>

Update for fedora 37 (& later)

after doing above, install vazirmatn which is now in official repos

sudo dnf install vazirmatn-fonts-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment