Just out of curiosity, is anyone using the fontconfig
way of mapping fonts? I turned it on one day, but the immediate
problem was that no mathtext worked any more; so I turned it back
off. Any mathtext in titles, labels, etc. just rendered as a much
of seemingly random letters.
That’s one of the drawbacks of the fontconfig mode – probably the
main reason it isn’t turned on by default. fontconfig only looks in
system-standard locations for fonts (by default), and matplotlib
installs its special math fonts in a different place. fontconfig
provides a C-level API to add another search directory, but it would
have to be wrapped for Python.
And I'll tack a second question in here as well; the reason
that I was playing with fontconfig is that the font cache takes
a really long time to build in certain circumstances (I’m having
trouble identifying exactly when)…so I guess the question
is…has anyone else seen this? For example, on my (2008
vintage) mac mini, a complete rebuild of the font cache takes
around 3 seconds, which is fine. On a macbook pro (tested on
three different machines so far), it takes 30 seconds. This
makes no sense at all to me, so any insights welcome
It's dependent on a) how many fonts you have installed and b) the
performance of the file system they are on. On my Linux machine
with a number of network shares involved, it can take a very long
I initially thought that perhaps the other users had a
ton more fonts than I, but I don’t think so…if I remember
correctly, their font cache on the macbook pro ended up
being smaller than mine on the mini.
It’s hard to say what might be causing this.
However, why are you concerned about it, since the cache only has to
be built once? (After all, that is the point of an on-disk font
cache in the first place…)