I suspect an explicit conversion to str may be required on your configuration/platform. (I think you mentioned you were using Windows).
Can you change line 592 of mathtext.py to read: font = FT2Font(str(basename)) and let me know if that fixes your problem? If so, I'll commit this to SVN. Note that you may also have problems if there are any non-ascii characters (with accents etc.) anywhere in the path to mpl's fonts. In general mpl doesn't really handle Unicode paths correctly wherever C/C++ code is involved. Hopefully that can be resolved in a future version. Cheers, Mike Jordan Dawe wrote: > Rob Hetland wrote: >> I really like Arev Sans, but others like the new STIX fonts. This >> setup is for Arev Sans. The important stuff is what begins with >> mathtext. If you want serif fonts, this should be enough to get you >> started on customizing. Just make sure whatever fontset you pick has >> all of the math symbols built in, or change fallback_to_cm to True. > When I converted my matplotlibrc to the settings you listed, the result > was pages and pages of exception tracebacks ending in: > > C:\Python25\Lib\site-packages\matplotlib\mathtext.py in _get_font(self, > font) > 590 cached_font = self._fonts.get(basename) > 591 if cached_font is None: > --> 592 font = FT2Font(basename) > 593 cached_font = self.CachedFont(font) > 594 self._fonts[basename] = cached_font > > If I remove all the LaTeX from my expressions, this error goes away. > > Jordan > > TypeError: cannot return std::string from Unicode object > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users