I'd like to remove a few fonts from the fontconfig match results for firefox.

I know there's <rejectfont>, but it removes the font completely and for everyone, like it doesn't exist in the system.

I've tried to prepend_first, but turns out firefox has its own font-selecting algorithm that gets all the matches from fontconfig and reorder them (seems like it prefers scalable fonts if it can't find an exact size match from a bitmap font, unlike fontconfig itself that has a more complex and configurable font-matching logic), so the unwanted fonts should be left out of the list altogether.

delete and delete_all edit modes don't seem to work for that matter.

Is there a way to handle this better than patching firefox itself?

1 Answer 1


You can use the FONTCONFIG_FILE or FONTCONFIG_PATH environment variables to change to fontconfig settings only for a process and its descendants:

$ cp /etc/fonts/fonts.conf /path/to/fonts-for-firefox.conf

# modify /path/to/fonts-for-firefox.conf as you see fit
# don't forget to change the include ..>conf.d< to >/etc/fonts/conf.d<

$ FONTCONFIG_FILE=/path/to/fonts-for-firefox.conf firefox ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.