# Firefox is creating a fontconfig directory. How can I avoid it?



## pieside (Nov 9, 2014)

Hi,

Firefox is systematically creating a fontconfig directory in my home directory. Do you think the problem can be solved by configuring anti-aliased fonts as described in section 6.5.3 here https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-fonts.html?


----------



## drhowarddrfine (Nov 9, 2014)

Why is it a problem?


----------



## Beeblebrox (Nov 9, 2014)

I was thinking of looking into that as well, thanks for reminding. The fontconfig directory is used by many app_lication_s BTW, not just Firefox. See fonts-conf(5)().

DrHoward of the Fine clan: At least for me, it's a "level3/10 annoyance" on the obsessive-compulsive scale. Also (and I'm probably mixing several issues here), XML-based configuration files should now belong under ~/.config?

Anyway, this may (or may not) work. While it seems to have only affected a small number of app_lication_s, don't hold me to it. in ~/.cshrc, place the below, and move the directory to specified location. Finally, restart Xorg.

```
setenv XDG_CONFIG_HOME  .config/fontconfig
```

EDIT: Nope, the fontconfig directory gets created again, and for a strange reason, some of the settings and history for GUI app_lication_s get reset after this (but none from  Mozilla).


----------



## drhowarddrfine (Nov 10, 2014)

Well, this is the font directory for Firefox and not for anything else and fonts can be set or changed by each individual user so that's why it's set there, I presume. It's not a global or user wide setting.


----------



## jrm@ (Nov 10, 2014)

I remember messing with this a few months ago and the problem was due to some upstream change with fontconfig related to xdg.  I have a comment in /usr/local/etc/fonts/fonts.conf and this entry:


```
<!-- Font cache directory list -->

	<cachedir>/var/db/fontconfig</cachedir>
	<!-- JRM <cachedir prefix="xdg">fontconfig</cachedir> -->
	<!-- the following element will be removed in the future -->
	<cachedir>~/.fontconfig</cachedir>
```

If I'm not mistaken, I commented out the line with xdg and added or uncommented the line with ~/.fontconfig.

ADDED: Here's a thread with more detail.  It looks like this solution is only a temporary fix to the problem.


----------



## Beeblebrox (Nov 10, 2014)

> Well, this is the font directory for Firefox and not for anything else


I forget to mention that I am merging Gnome3 ports, which sometimes causes different behaviour. As a result, my fontconfig now seems to house history and settings for: enchant, epiphany, libfm, midori and pcmanfm. The epiphany directory has files like bookmarks, cookies, session_state, history, etc. for example.

I have asked about this on the GNOME 3 mailing list and am waiting for answer. Considering that GNOME 3 will be merged to ports at some near point, I surmise this will become a future issue.


----------



## Beeblebrox (Nov 11, 2014)

/usr/local/etc/fonts/fonts.conf states:


> DO NOT EDIT THIS FILE. IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED. LOCAL CHANGES BELONG IN 'local.conf'


I suppose (I have not tried yet) that means the modification belongs in ~/local.conf officially, which is also an ugly solution (should be ~/.local.conf or something like that).


----------

