Unfortunately, this isn't a complete solution.  The purpose of the 
"escape_xml_chars" function is to escape characters that have special meaning 
in XML, e.g. "&" -> "&amp;", "<" -> "&lt;" etc.  The "xmlcharrefreplace" option 
on encode() does not do that.

I am surprised that you got this traceback, as the SVG is output using a UTF-8 
EncodedFile object, which should be able to handle any unicode characters you 
throw at it.  Can you provide a short, standalone example that reproduces the 
error, and some information about your platform, so I can examine further?

As for your suggestion to encode mathematical characters as unicode, 
unfortunately that would only partially.  In order to layout the mathematical 
expressions, we must have the same font available at generation and rendering 
time to know the size of the characters and therefore how to place them next to 
each other correctly.  That said, if you use the STIX fonts (set 
"mathtext.fontset" to "STIX"), those do use a Unicode-based encoding rather 
than the arbitrary one used by the Bakoma Computer Modern fonts.  Of course, 
generating a math expression using the STIX fonts and rendering it using a 
different Unicode math font is not guaranteed to work well -- you are almost 
certain to get overlapping or misplaced glyphs.

Mike

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to