Damon McDougall <damon.mcdoug...@gmail.com> writes:

> (Pdb) p fh
> <closed file '/Users/Damon/Library/Fonts/lcmssi8.afm', mode 'r' at  

That's a font that probably came with a TeX distribution and somehow got
installed in your font library.

> (Pdb) p line
> 'C 0 ; WX 708.333 ; N Gamma ; B 0 0 836.364 684.027 ;'

Failing on this line is a bug in matplotlib, since the AFM spec says
that bounding-box coordinates are "numbers", not "integers". Apparently
not many AFM files use that precise bounding boxes, since we haven't run
into this before.

I don't know how the MacPorts packaging system would react to modifying
installed files, but I imagine that applying the attached patch should
fix this.

> Also, after some curiosity, I realised the file ~/.matplotlib/ 
> fontList.cache doesn't exist. In fact, the ~/.matplotlib directory is  
> empty, there aren't even any hidden files. On my other computer,  
> matplotlib works fine and the ~/.matplotlib directory contains three  
> files: fontList.cache, fontManager.cache and tex.cache.

Maybe the files just didn't get written into your directory, since
matplotlib bailed out at the first failure.

Index: lib/matplotlib/afm.py
===================================================================
--- lib/matplotlib/afm.py	(revision 7750)
+++ lib/matplotlib/afm.py	(working copy)
@@ -165,7 +165,8 @@
         num = _to_int(vals[0].split()[1])
         wx = _to_float(vals[1].split()[1])
         name = vals[2].split()[1]
-        bbox = _to_list_of_ints(vals[3][2:])
+        bbox = _to_list_of_floats(vals[3][2:])
+        bbox = map(int, bbox)
         # Workaround: If the character name is 'Euro', give it the corresponding
         # character code, according to WinAnsiEncoding (see PDF Reference).
         if name == 'Euro':
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to