Michael Droettboom skrev:
put the pfm/pfb files it somewhere else and have matplotlib use it?
I believe Nimbus Roman is just a clone of Times that is included with Ghostscript.

http://www.tug.dk/FontCatalogue/nimbus/

If you have Times or Times New Roman installed, that's probably a reasonable substitute.


I tried to use usetex to generate my pdf figures but I got a crash when saving the figure, log attached. I traced the crash to find_tex_file(), apparently ' can not be used to quote filenames in the windows shell it has to be ". In my patch I just changed it to always use " I don't know if that works on other systems.

/Jörgen
matplotlib data path 
C:\Python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\mpl-data
loaded rc file C:\python\bugreports\matplotlib\matplotlibrc
matplotlib version 0.98.4
verbose.level debug
interactive is False
units is False
platform is win32
loaded modules: ['xml.sax.urlparse', 'distutils', 'matplotlib.errno', 
'matplotlib.matplotlib', 'subprocess', 'gc', 'matplotlib.tempfile', 
'distutils.sysconfig', 'ctypes._endian', 'encodings.encodings', 
'matplotlib.colors', 'msvcrt', 'numpy.testing.sys', 'numpy.core.info', 'xml', 
'numpy.fft.types', 'numpy.ma.operator', 'numpy.ma.cPickle', 'struct', 
'numpy.random.info', 'tempfile', 'xml.sax.urllib', 'numpy.linalg', 
'matplotlib.threading', 'numpy.testing.operator', 'imp', 'numpy.testing', 
'collections', 'numpy.core.umath', 'numpy.lib.pkgutil', 'distutils.types', 
'numpy.lib.numpy', 'numpy.core.scalarmath', 'zipimport', 'string', 
'matplotlib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 
'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 
'matplotlib.__future__', 'numpy.testing.re', 'itertools', 'numpy.version', 
'numpy.lib.re', 'distutils.re', 'ctypes.os', 'numpy.core.os', 
'numpy.lib.type_check', 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 
'random', 'threading', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 
'ctypes.ctypes', 'xml.sax.xmlreader', 'numpy.__builtin__', 'distutils.version', 
'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO', 'locale', 
'numpy.add_newdocs', 'numpy.lib.getlimits', 'xml.sax.saxutils', 
'numpy.testing.types', 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 
'numpy.lib.io', 'numpy.imp', 'numpy.ma.extras', 'numpy.testing.decorators', 
'matplotlib.warnings', 'matplotlib.string', '_subprocess', 'urllib', 
'matplotlib.sys', 're', 'numpy.lib._compiled_base', 'ntpath', 
'numpy.random.mtrand', 'math', 'numpy.fft.helper', 'numpy.ma.warnings', 
'matplotlib.numpy', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 
'matplotlib', 'numpy.fft.numpy', 'numpy.lib.ufunclike', 'numpy.lib.info', 
'numpy.core.numerictypes', 'ctypes', 'numpy.lib.warnings', 'ctypes.struct', 
'codecs', 'numpy.core._sort', 'numpy.os', '_locale', 
'matplotlib.sre_constants', 'matplotlib.os', 'thread', 'StringIO', 
'numpy.core.memmap', 'traceback', '_struct', 'numpy.testing.warnings', 
'weakref', 'numpy.core._internal', 'numpy.fft.fftpack', 'numpy.testing.imp', 
'numpy.linalg.lapack_lite', 'distutils.sys', 'os', 'numpy.lib.itertools', 
'__future__', 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', 
'_sre', 'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg.numpy', 
'__builtin__', 'numpy.lib.twodim_base', 'matplotlib.re', 'numpy.core.cPickle', 
'operator', 'numpy.testing.parametric', 'numpy.core.arrayprint', 
'distutils.string', 'numpy.lib.arrayterator', 'ctypes._ctypes', 'ctypes.sys', 
'matplotlib.datetime', 'numpy.testing.nosetester', 'pkgutil', 
'numpy.lib.financial', 'numpy.core.multiarray', 'errno', '_socket', 'binascii', 
'sre_constants', 'datetime', 'numpy.ma', 'xml.sax.handler', 'types', 
'numpy.lib.stride_tricks', 'numpy.core.numpy', 'numpy', 'matplotlib.types', 
'numpy.core.defmatrix', 'xml.sax.os', 'cPickle', 'matplotlib.xml', '_codecs', 
'numpy.lib.operator', 'encodings.cp1252', 'matplotlib.pyparsing', 'nturl2path', 
'numpy.ma.numpy', 'copy', 'numpy.core.re', 'socket', '_types', 
'numpy.core.fromnumeric', 'numpy.ctypeslib', 'numpy.lib.scimath', 'numpy.fft', 
'numpy.lib', 'numpy.random.numpy', 'encodings.aliases', 'matplotlib.distutils', 
'exceptions', 'sre_parse', 'numpy.core.cStringIO', 'numpy.core.ctypes', 
'distutils.distutils', 'copy_reg', 'sre_compile', 'xml.sax', '_random', 
'numpy.lib.__future__', 'site', 'numpy.lib.polynomial', 'numpy._import_tools', 
'numpy.core.copy_reg', '__main__', 'numpy.fft.info', 'numpy.core.records', 
'shutil', 'numpy.lib.cPickle', 'numpy.sys', 'matplotlib.weakref', 
'numpy.core._dotblas', 'numpy.testing.traceback', 'strop', 
'numpy.testing.numpytest', 'numpy.core.numeric', 'numpy.linalg.info', 
'encodings.codecs', 'numpy.core.__svn_version__', 'numpy.ctypes', 'numpy.core', 
'matplotlib.rcsetup', 'matplotlib.time', 'nt', 'xml.sax._exceptions', 
'xml.sax.codecs', 'stat', '_ssl', 'numpy.lib.utils', 'numpy.lib.index_tricks', 
'warnings', 'encodings.types', 'numpy.core.defchararray', '_ctypes', 
'numpy.lib.shape_base', 'numpy.core.types', 'sys', 'numpy.core.warnings', 
'numpy.core.__builtin__', 'xml.sax.sys', 'numpy.lib.format', 'numpy.lib.os', 
'numpy.__config__', 'os.path', 'numpy.lib.shutil', 
'matplotlib.fontconfig_pattern', '_weakref', 'distutils.errors', 'urlparse', 
'linecache', 'matplotlib.shutil', 'numpy.lib.cStringIO', 'time', 
'numpy.lib.machar', 'numpy.testing.numpy', 'numpy.linalg.linalg', 
'numpy.testing.utils']
$HOME=c:\documents and settings\jörgen stenarson\
CONFIGDIR=c:\documents and settings\jörgen stenarson\.matplotlib
Using fontManager instance from c:\documents and settings\jörgen 
stenarson\.matplotlib\fontList.cache
backend TkAgg version 8.4
Found dvipng version 1.9
No LaTeX-compatible font found for the monospace font family in rcParams. Using 
default.
No LaTeX-compatible font found for the monospace font family in rcParams. Using 
default.
Dvi: c:\documents and settings\jörgen 
stenarson\.matplotlib\tex.cache\342a49751566a29dab1cfcec0a04bf79.dvi
find_tex_file(cmr12.tfm): kpsewhich 'cmr12.tfm'
find_tex_file result: 
Traceback (most recent call last):
  File "C:\python\bugreports\matplotlib\latex_fonts_problem.py", line 31, in 
<module>
    pylab.savefig("no_nimbus.pdf")
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\pyplot.py",
 line 345, in savefig
    return fig.savefig(*args, **kwargs)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\figure.py",
 line 990, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\backend_bases.py",
 line 1393, in print_figure
    **kwargs)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\backend_bases.py",
 line 1287, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\backends\backend_pdf.py",
 line 1883, in print_pdf
    self.figure.draw(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\figure.py",
 line 772, in draw
    for a in self.axes: a.draw(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\axes.py",
 line 1601, in draw
    a.draw(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\axis.py",
 line 710, in draw
    tick.draw(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\axis.py",
 line 193, in draw
    self.label1.draw(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\text.py",
 line 448, in draw
    bbox, info = self._get_layout(renderer)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\text.py",
 line 246, in _get_layout
    'lp', self._fontproperties, ismath=False)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\backends\backend_pdf.py",
 line 1578, in get_text_width_height_descent
    page = iter(dvi).next()
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\dviread.py",
 line 63, in __iter__
    have_page = self._read()
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\dviread.py",
 line 120, in _read
    self._dispatch(byte)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\dviread.py",
 line 208, in _dispatch
    self._fnt_def(k, c, s, d, a, l, n)
  File 
"c:\python25\lib\site-packages\matplotlib-0.98.4-py2.5-win32.egg\matplotlib\dviread.py",
 line 362, in _fnt_def
    if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
AttributeError: 'NoneType' object has no attribute 'checksum'
Index: matplotlib/dviread.py
===================================================================
--- matplotlib/dviread.py       (revision 6561)
+++ matplotlib/dviread.py       (working copy)
@@ -745,9 +745,9 @@
     cmd = 'kpsewhich '
     if format is not None:
         assert "'" not in format
-        cmd += "--format='" + format + "' "
+        cmd += '--format="%s" '%format
     assert "'" not in filename
-    cmd += "'" + filename + "'"
+    cmd += '"%s"'%filename
 
     matplotlib.verbose.report('find_tex_file(%s): %s' \
                                   % (filename,cmd), 'debug')
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to