Revision: 7280
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7280&view=rev
Author:   evilguru
Date:     2009-07-21 19:30:28 +0000 (Tue, 21 Jul 2009)

Log Message:
-----------
Port the menu example over to mathtex. Fonts could use some work.

Modified Paths:
--------------
    branches/mathtex/examples/widgets/menu.py

Modified: branches/mathtex/examples/widgets/menu.py
===================================================================
--- branches/mathtex/examples/widgets/menu.py   2009-07-21 17:30:20 UTC (rev 
7279)
+++ branches/mathtex/examples/widgets/menu.py   2009-07-21 19:30:28 UTC (rev 
7280)
@@ -2,11 +2,11 @@
 import matplotlib
 import matplotlib.colors as colors
 import matplotlib.patches as patches
-import matplotlib.mathtext as mathtext
 import matplotlib.pyplot as plt
 import matplotlib.artist as artist
 import matplotlib.image as image
 
+from mathtex.mathtex_main import Mathtex
 
 class ItemProperties:
     def __init__(self, fontsize=14, labelcolor='black', bgcolor='yellow', 
alpha=1.0):
@@ -19,7 +19,6 @@
         self.bgcolor_rgb = colors.colorConverter.to_rgb(bgcolor)
 
 class MenuItem(artist.Artist):
-    parser = mathtext.MathTextParser("Bitmap")
     padx = 5
     pady =5
     def __init__(self, fig, labelstr, props=None, hoverprops=None, 
on_select=None):
@@ -40,8 +39,8 @@
 
         self.on_select = on_select
 
-        x, self.depth = self.parser.to_mask(
-            labelstr, fontsize=props.fontsize, dpi=fig.dpi)
+        m = Mathtex(labelstr, fontsize=props.fontsize, dpi=fig.dpi)
+        x, self.depth = m.as_mask(), m.depth
 
         if props.fontsize!=hoverprops.fontsize:
             raise NotImplementedError('support for different font sizes not 
implemented')


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

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to