|
From: <md...@us...> - 2007-08-06 18:49:20
|
Revision: 3674
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3674&view=rev
Author: mdboom
Date: 2007-08-06 11:49:19 -0700 (Mon, 06 Aug 2007)
Log Message:
-----------
Fix bug when rendering character codes > 255 in PDF
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-08-03 19:47:49 UTC (rev 3673)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-08-06 18:49:19 UTC (rev 3674)
@@ -1103,7 +1103,7 @@
oldx, oldy = 0, 0
for record in pswriter:
if record[0] == 'glyph':
- rec_type, ox, oy, fontname, fontsize, glyph = record
+ rec_type, ox, oy, fontname, fontsize, num = record
a = angle / 180.0 * pi
newx = x + cos(a)*ox - sin(a)*oy
newy = y + sin(a)*ox + cos(a)*oy
@@ -1114,7 +1114,10 @@
Op.selectfont)
prev_font = fontname, fontsize
- string = chr(glyph)
+ if num < 256:
+ string = chr(num)
+ else:
+ string = "?"
self.file.output(string, Op.show)
self.file.output(Op.end_text)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|