Skip to content

Instantly share code, notes, and snippets.

@Francesco149
Created September 20, 2016 23:07
Show Gist options
  • Save Francesco149/98032bece1e41591eb08a98b3dbc3036 to your computer and use it in GitHub Desktop.
Save Francesco149/98032bece1e41591eb08a98b3dbc3036 to your computer and use it in GitHub Desktop.

How to disable font antialiasing on Firefox

On many distros (in my case mint) firefox does not pick up fontconfig settings when you disable font antialiasing or mess with the hinting. Especially if it's statically linked to its own cairo instead of using the system's version.

This is easily fixed by creating a .fonts.conf file in your home directory that forces the desired hinting and antialiasing values:

cat > ~/.fonts.conf << "EOF"
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

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

</fontconfig>
EOF

Setting font aliases here also works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment