I’m writing a Python program that uses matplotlib. I’d like to use a font that isn’t included with matplotlib. (Well, I want to use Lucida Grande, which is included in OS X, but matplotlib can’t read the .dfont file directly so I need to distribute my own .ttf font.)
It seems like matplotlib only ever looks in one directory for fonts: mpl-data/fonts
. It’s possible to tweak matplotlib’s configuration to change where the mpl-data
directory is, but it doesn’t seem to be possible to specify more than one such directory in which fonts may be found. Is that accurate?
(It would be possible for me to put the font in my system’s global mpl-data
directory, but it feels wrong for an application to muck around with a globally-used directory like that. And I sure as hell don’t want to include the entire mpl-data
-plus-one-file with my application.)