From: LUK S. <shu...@po...> - 2003-11-06 15:00:05
|
John Hunter wrote: > > LUK> Another question: I've set the environmental variable AFMPATH > LUK> in the registry via the control panel but matplotlib > LUK> complains that the .afm files are not there. > > I cannot replicate this problem on my system. Are the *.afm files in > E:\Py23e\share\matplotlib? Are you sure you are running the right > version of python, ie, do you still get the error with > > > E:\Py23e\python simple_plot.ps -dPS > [snipped] > > And let me know what it reports. If you are using the fonts that ship > with matplotlib, you shouldn't even need to set the AFMPATH because it > automatically looks in the share/matplotlib subdir of your python > install dir. I can confirm that if the font files are installed in the default location under the system python tree, it works. Setting AFMPATH also works in linux. > > You may also want to verify that matplotlib is finding your > environment variable by doing > > >>python >> >>>>import os >>>>print os.environ.has_key('AFMPATH') > >>> import os >>> os.environ["AFMPATH"] 'E:\\Py23e\\share\\matplotlib' > > If the *.afm fonts are in the share/matplotlib dir, and you are using > the right python, and the paths look correct from the diagnostic > information above, the only thing I can think of is that these files > are not readable by you (admin versus user thing?). To test this try > > >>python >> >>>>fh = file('E:\Py23e\\share\\matplotlib\\phvl8a.afm', 'r') >>>>s = fh.read() >>>>len(s) > >>> fh = file('E:\Py23e\\share\\matplotlib\\afm\\phvl8a.afm', 'r') >>> len(fh.read()) 15627 > > Let me know.... > JDH > Regards, ST -- |