I just finished writing code to support scalable mathtext with the Cairo backend. (The old version rendered the mathtext to bitmaps first).
Mostly straightforward, but I ran into one small snag. It *seems* that pycairo requires that the fonts it uses are installed and accessible through fontconfig, i.e. you can not load a font by filename. Not a big deal, but there is also no way to tell if a particular font family matched exactly, and thus no way to warn a user that they need to install the Bakoma fonts. There are some ways out of this. It appears possible to load a font from a file for Cairo in C (though apparently different for each platform). I would hate to have to support another extension in matplotlib, but maybe the pycairo folks would be amenable to adding this. Probably worth dropping a note to the pycairo list either way. Or, we could find some way to install fonts automatically. That's fundamentally a packaging/distribution issue. All this raises a much larger question of whether we want to replace font_manager.py with something like fontconfig. There don't appear to be Python wrappers for it, but it would eliminate a number of issues with font_manager.py : a) it would look up fonts in the same way as many other apps in the OS (rather than from hard-coded folders), and b) seems a little more correct in how it looks up fonts and substitutes for missing fonts etc. For instance, if font_manager.py doesn't find an exact match, it always returns Vera Sans, rather than returning something with the same slant and weight as what you requested. There would be no need to manually flush the matplotlib font cache, since fontconfig would deal with all of that. [The Python wrappers are probably a non-issue on Unix-like systems, since you can call out to the "fc-match" command for lookup.] This may be more effort than it's worth -- but I wanted to get opinions from others on this list. Cheers, Mike ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel