Revision: 7296
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7296&view=rev
Author:   evilguru
Date:     2009-07-27 12:30:35 +0000 (Mon, 27 Jul 2009)

Log Message:
-----------
Add support for rcParams['mathtext.default'], currently broken due to a 
suspected bug in mathtex.

Modified Paths:
--------------
    branches/mathtex/lib/matplotlib/backends/backend_agg.py
    branches/mathtex/lib/matplotlib/backends/backend_cairo.py
    branches/mathtex/lib/matplotlib/backends/backend_gdk.py
    branches/mathtex/lib/matplotlib/backends/backend_pdf.py
    branches/mathtex/lib/matplotlib/backends/backend_ps.py
    branches/mathtex/lib/matplotlib/backends/backend_svg.py

Modified: branches/mathtex/lib/matplotlib/backends/backend_agg.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_agg.py     2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_agg.py     2009-07-27 
12:30:35 UTC (rev 7296)
@@ -110,7 +110,8 @@
         if __debug__: verbose.report('RendererAgg.draw_mathtext',
                                      'debug-annoying')
         if HAVE_MATHTEX:
-            m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), self.dpi)
+            m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(),
+                        self.dpi, rcParams['mathtext.default'])
             b = MathtexBackendImage()
 
             m.render_to_backend(b)
@@ -164,7 +165,8 @@
                               'Math will not be rendered.')
                 return 0.0, 0.0, 0.0
             else:
-                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), self.dpi)
+                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(),
+                            self.dpi, rcParams['mathtext.default'])
                 return m.width, m.height, m.depth
         font = self._get_agg_font(prop)
         font.set_text(s, 0.0, flags=LOAD_FORCE_AUTOHINT)  # the width and 
height of unrotated string

Modified: branches/mathtex/lib/matplotlib/backends/backend_cairo.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_cairo.py   2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_cairo.py   2009-07-27 
12:30:35 UTC (rev 7296)
@@ -210,7 +210,8 @@
 
         ctx = gc.ctx
 
-        m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), self.dpi)
+        m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(),
+                    self.dpi, rcParams['mathtext.default'])
         b = MathtexBackendCairo()
         m.render_to_backend(b)
 
@@ -240,7 +241,8 @@
         if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
         if ismath:
             if HAVE_MATHTEX:
-                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), self.dpi)
+                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(),
+                            self.dpi, rcParams['mathtext.default'])
                 return m.width, m.height, m.depth
             else:
                 warnings.warn('matplotlib was compiled without mathtex 
support. ' +

Modified: branches/mathtex/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_gdk.py     2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_gdk.py     2009-07-27 
12:30:35 UTC (rev 7296)
@@ -167,7 +167,7 @@
             return
 
         m = Mathtex(s, matplotlib.rcParams['mathtext.fontset'],
-                    prop.get_size_in_points(), self.dpi)
+                    prop.get_size_in_points(), self.dpi, 
rcParams['mathtext.default'])
         b = MathtexBackendImage()
         m.render_to_backend(b)
 
@@ -318,7 +318,7 @@
                 return 0.0, 0.0, 0.0
             else:
                 m = Mathtex(s, matplotlib.rcParams['mathtext.fontset'],
-                            prop.get_size_in_points(), self.dpi)
+                            prop.get_size_in_points(), self.dpi, 
rcParams['mathtext.default'])
                 return m.width, m.height, m.depth
 
         layout, inkRect, logicalRect = self._get_pango_layout(s, prop)

Modified: branches/mathtex/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_pdf.py     2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_pdf.py     2009-07-27 
12:30:35 UTC (rev 7296)
@@ -1351,7 +1351,8 @@
         if not HAVE_MATHTEX:
             return
 
-        m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), 72.0)
+        m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(),
+                    72.0, rcParams['mathtext.default'])
 
         # Generate the dict of used characters
         used_characters = {}
@@ -1668,7 +1669,7 @@
                 w, h, d = 0.0, 0.0, 0.0
             else:
                 m = Mathtex(s, rcParams['mathtext.fontset'],
-                            prop.get_size_in_points(), 72.0)
+                            prop.get_size_in_points(), 72.0, 
rcParams['mathtext.default'])
                 w, h, d = m.width, m.height, m.depth
 
         elif rcParams['pdf.use14corefonts']:

Modified: branches/mathtex/lib/matplotlib/backends/backend_ps.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_ps.py      2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_ps.py      2009-07-27 
12:30:35 UTC (rev 7296)
@@ -282,7 +282,8 @@
 
         if ismath:
             if HAVE_MATHTEX:
-                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), 72.0)
+                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(),
+                            72.0, rcParams['mathtext.default'])
                 return m.width, m.height, m.depth
             else:
                 warnings.warn('matplotlib was compiled without mathtex 
support. ' +
@@ -750,7 +751,8 @@
         if not HAVE_MATHTEX:
             return
 
-        m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), 72.0)
+        m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(),
+                    72.0, rcParams['mathtext.default'])
 
         # Generate the dict of used characters
         used_characters = {}

Modified: branches/mathtex/lib/matplotlib/backends/backend_svg.py
===================================================================
--- branches/mathtex/lib/matplotlib/backends/backend_svg.py     2009-07-26 
17:53:54 UTC (rev 7295)
+++ branches/mathtex/lib/matplotlib/backends/backend_svg.py     2009-07-27 
12:30:35 UTC (rev 7296)
@@ -494,7 +494,8 @@
         if not HAVE_MATHTEX:
             return
 
-        m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(), 72.0)
+        m = Mathtex(s, rcParams['mathtext.fontset'], prop.get_size_in_points(),
+                    72.0, rcParams['mathtext.default'])
 
         # Extract the glyphs and rects to render
         svg_glyphs = [(info.font, info.fontsize, unichr(info.num),
@@ -600,8 +601,8 @@
     def get_text_width_height_descent(self, s, prop, ismath):
         if ismath:
             if HAVE_MATHTEX:
-                m = Mathtex(s, rcParams['mathtext.fontset'],
-                            prop.get_size_in_points(), 72.0)
+                m = Mathtex(s, rcParams['mathtext.fontset'], 
prop.get_size_in_points(),
+                            72.0, rcParams['mathtext.default'])
                 return m.width, m.height, m.depth
             else:
                 warnings.warn('matplotlib was compiled without mathtex 
support. ' +


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

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to