On 10/12/2009 04:17 PM, Jouni K. Seppänen wrote:
> <phob...@geosyntec.com>  writes:
>
>    
>>    File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", 
>> line 1378, in draw_mathtext
>>      self.file.output(self.encode_string(unichr(num), fonttype), Op.show)
>> ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>>      
> Right, IPython really had mangled the traceback. That looks like the
> mathtext parser is outputting some characters outside the Basic
> Multilingual Plane. Could you try the following:
>
> python -i c:\GDAG2009\python\pyTest.py -d pdf
>
> Then when the error occurs, you should be at a Python prompt. Then type
> (or just copy and paste from here - be careful with the first two lines,
> since any exception will cause Python to forget the existing traceback):
>
> from pdb import pm
> pm()
> p fontname, fontsize, num, symbol_name
> p s, width, height, descent, glyphs, rects, used_characters
> p fonttype, global_fonttype
>
> It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it
> helps, it would be useful to find the root of this problem.
>
>    
What is your mathtext.fontset setting?  If it's stixsans, then it is 
possible that mathtext would produce codepoints outside of the BMP (this 
is due to the way the STIX fonts are encoded).  Unfortunately, the 
standard Python builds for Windows don't support characters in this range.

There might actually be a work around possible in the PDF backend -- but 
it will have to involve encoding Unicode characters without using Python 
unicode objects.  I'm looking into a patch now.

Cheers,
Mike

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) 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 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to