From: <sk...@po...> - 2005-10-03 20:11:11
|
I installed the fink version of mpl on my 10.3.9 laptop the other day. I've not been able to work around font problems and am looking for suggestions. When I run "ipython -pylab" (GTKAgg backend) I get this traceback: File "/sw/bin/ipython", line 28, in ? IPython.Shell.start().mainloop() File "/sw/lib/python2.3/site-packages/IPython/Shell.py", line 883, in start return shell() File "/sw/lib/python2.3/site-packages/IPython/Shell.py", line 810, in __init__ IPShellGTK.__init__(self,argv,user_ns,debug,shell_class=MatplotlibMTShell) File "/sw/lib/python2.3/site-packages/IPython/Shell.py", line 618, in __init__ on_kill=[mainquit]) File "/sw/lib/python2.3/site-packages/IPython/ipmaker.py", line 85, in make_IPython IP = shell_class('__IP',user_ns=user_ns,**kw) File "/sw/lib/python2.3/site-packages/IPython/Shell.py", line 500, in __init__ user_ns,b2 = self._matplotlib_config(name) File "/sw/lib/python2.3/site-packages/IPython/Shell.py", line 373, in _matplotlib_config from matplotlib import backends File "/sw/lib/python2.3/site-packages/matplotlib/backends/__init__.py", line 56, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File "/sw/lib/python2.3/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup globals(),locals(),[backend_name]) File "/sw/lib/python2.3/site-packages/matplotlib/backends/backend_gtkagg.py", line 8, in ? from matplotlib.figure import Figure File "/sw/lib/python2.3/site-packages/matplotlib/figure.py", line 3, in ? from axes import Axes, Subplot, PolarSubplot, PolarAxes File "/sw/lib/python2.3/site-packages/matplotlib/axes.py", line 14, in ? from axis import XAxis, YAxis File "/sw/lib/python2.3/site-packages/matplotlib/axis.py", line 25, in ? from font_manager import FontProperties File "/sw/lib/python2.3/site-packages/matplotlib/font_manager.py", line 993, in ? fontManager = FontManager() File "/sw/lib/python2.3/site-packages/matplotlib/font_manager.py", line 837, in __init__ rebuild() File "/sw/lib/python2.3/site-packages/matplotlib/font_manager.py", line 830, in rebuild self.ttfdict = createFontDict(self.ttffiles) File "/sw/lib/python2.3/site-packages/matplotlib/font_manager.py", line 456, in createFontDict font = ft2font.FT2Font(str(fpath)) RuntimeError: Could not load facefile /Library/Fonts/CharcoalCY.dfont; Unknown_File_Format I went looking for a solution and found this page: http://www.soe.ucsc.edu/~you/notes/matplotlib-fink-install.html It suggested copying ttf files from Windows, setting TTFPATH and removing ~/.ttfont.cache. Not having Windows, I poked around some more and found fondu: http://fondu.sourceforge.net/ I downloaded and built that, then converted all the fonts in /Library/Fonts, set TTFPATH and removed ~/.ttfont.cache. No change. Any ideas? Thx, -- Skip Montanaro Katrina Benefit Concerts: http://www.musi-cal.com/katrina sk...@po... |
From: John H. <jdh...@ac...> - 2005-10-06 13:36:49
|
>>>>> "skip" == skip <sk...@po...> writes: skip> I installed the fink version of mpl on my 10.3.9 laptop the skip> other day. I've not been able to work around font problems skip> and am looking for suggestions. When I run "ipython -pylab" skip> (GTKAgg backend) I get this traceback: skip> line 456, in createFontDict font = skip> ft2font.FT2Font(str(fpath)) RuntimeError: Could not load skip> facefile /Library/Fonts/CharcoalCY.dfont; skip> Unknown_File_Format What version of matplotlib are you using. In recent versions we've tried to me more friendly about catching exceptions, warning, and then moving on, rather than failing. There are many mac ttf fonts that fail and I don't know why (what version of freetype are you using?). I suggest either upgrading to the most recent mpl which should be tolerant of bad fonts. If that doesn't work, you might want to look into the font_manager module, and hack the font finding machinery to just return the mpl system fonts (eg Vera*). If you search for self.ttffiles = findSystemFonts(paths) + findSystemFonts() you'll find the spot where the font search list is set and you could manually hack this. We could provide an override setting for the font manager in rc that says "just use such and such font dirs". Let me know if any of this helps, JDH |
From: <sk...@po...> - 2005-10-06 17:28:59
|
skip> I installed the fink version of mpl on my 10.3.9 laptop the other skip> day. I've not been able to work around font problems ... John> What version of matplotlib are you using. According to fink I am using matplotlib-py24 0.84-2 freetype219 2.1.9-1 freetype219-shlibs 2.1.9-1 The -1 and -2 are presumably fink package numbers. John> I suggest either upgrading to the most recent mpl which should be John> tolerant of bad fonts. Unfortunately, I think I'm as up-to-date as I can get, right? John> If that doesn't work, you might want to look into the font_manager John> module, and hack the font finding machinery to just return the mpl John> system fonts (eg Vera*). If you search for John> self.ttffiles = findSystemFonts(paths) + findSystemFonts() John> you'll find the spot where the font search list is set and you John> could manually hack this. We could provide an override setting John> for the font manager in rc that says "just use such and such font John> dirs". Thanks, I'll check into this this evening... Skip |