Revision: 5568
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5568&view=rev
Author:   mdboom
Date:     2008-06-17 06:02:56 -0700 (Tue, 17 Jun 2008)

Log Message:
-----------
Store integers rather than unicode strings in used_characters mapping
to get around narrow Unicode problems on some platforms.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
    trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
    trunk/matplotlib/lib/matplotlib/mathtext.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2008-06-17 
12:10:43 UTC (rev 5567)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2008-06-17 
13:02:56 UTC (rev 5568)
@@ -689,7 +689,7 @@
             differences = []
             multi_byte_chars = Set()
             for c in characters:
-                ccode = ord(c)
+                ccode = c
                 gind = cmap.get(ccode) or 0
                 glyph_ids.append(gind)
                 glyph_name = font.get_glyph_name(gind)
@@ -805,7 +805,7 @@
             widths = []
             max_ccode = 0
             for c in characters:
-                ccode = ord(c)
+                ccode = c
                 gind = cmap.get(ccode) or 0
                 glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
                 widths.append((ccode, glyph.horiAdvance / 6))
@@ -1209,7 +1209,7 @@
         realpath, stat_key = get_realpath_and_stat(fname)
         used_characters = self.used_characters.setdefault(
             stat_key, (realpath, Set()))
-        used_characters[1].update(s)
+        used_characters[1].update([ord(x) for x in s])
 
     def merge_used_characters(self, other):
         for stat_key, (realpath, set) in other.items():

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py      2008-06-17 
12:10:43 UTC (rev 5567)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py      2008-06-17 
13:02:56 UTC (rev 5568)
@@ -158,7 +158,7 @@
         realpath, stat_key = get_realpath_and_stat(font.fname)
         used_characters = self.used_characters.setdefault(
             stat_key, (realpath, Set()))
-        used_characters[1].update(s)
+        used_characters[1].update([ord(x) for x in s])
 
     def merge_used_characters(self, other):
         for stat_key, (realpath, set) in other.items():
@@ -975,7 +975,7 @@
                     cmap = font.get_charmap()
                     glyph_ids = []
                     for c in chars:
-                        gind = cmap.get(ord(c)) or 0
+                        gind = cmap.get(c) or 0
                         glyph_ids.append(gind)
                     # The ttf to ps (subsetting) support doesn't work for
                     # OpenType fonts that are Postscript inside (like the

Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 12:10:43 UTC (rev 
5567)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-06-17 13:02:56 UTC (rev 
5568)
@@ -526,7 +526,7 @@
         realpath, stat_key = get_realpath_and_stat(info.font.fname)
         used_characters = self.used_characters.setdefault(
             stat_key, (realpath, Set()))
-        used_characters[1].update(unichr(info.num))
+        used_characters[1].add(info.num)
         self.mathtext_backend.render_glyph(ox, oy, info)
 
     def render_rect_filled(self, x1, y1, x2, y2):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to