Revision: 5295
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5295&view=rev
Author:   mdboom
Date:     2008-05-28 11:22:39 -0700 (Wed, 28 May 2008)

Log Message:
-----------
Merged revisions 5284-5294 via svnmerge from 
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint

........
r5292 | jdh2358 | 2008-05-28 14:03:15 -0400 (Wed, 28 May 2008) | 1 line

added keywords to configure sliders for sf patch 1866207 
........
r5293 | mdboom | 2008-05-28 14:13:05 -0400 (Wed, 28 May 2008) | 3 lines

Fix PDFs that crash xpdf and ghostscript when two-byte codepoints are
used with Type 3 fonts.

........
r5294 | mdboom | 2008-05-28 14:19:30 -0400 (Wed, 28 May 2008) | 2 lines

Adding CHANGELOG entry and scary comment about what was going wrong.

........

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/examples/widgets/sliders.py
    trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
    trunk/matplotlib/lib/matplotlib/widgets.py

Property Changed:
----------------
    trunk/matplotlib/


Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/v0_91_maint:1-5283
   + /branches/v0_91_maint:1-5294

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2008-05-28 18:19:30 UTC (rev 5294)
+++ trunk/matplotlib/CHANGELOG  2008-05-28 18:22:39 UTC (rev 5295)
@@ -1,3 +1,11 @@
+2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte
+           characters are used with Type 3 fonts - MGD
+
+2008-05-28 Allow keyword args to configure widget properties as
+           requested in
+           
http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722
+           - JDH
+
 2008-05-28 REVERTING due to PDF problem.  Replaced '-' with u'\u2212'
            for minus sign as requested in
            
http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720

Modified: trunk/matplotlib/examples/widgets/sliders.py
===================================================================
--- trunk/matplotlib/examples/widgets/sliders.py        2008-05-28 18:19:30 UTC 
(rev 5294)
+++ trunk/matplotlib/examples/widgets/sliders.py        2008-05-28 18:22:39 UTC 
(rev 5295)
@@ -12,8 +12,8 @@
 axfreq = axes([0.125, 0.1, 0.775, 0.03], axisbg=axcolor)
 axamp  = axes([0.125, 0.15, 0.775, 0.03], axisbg=axcolor)
 
-sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1)
-samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1)
+sfreq = Slider(axfreq, 'Freq', 0.1, 30.0, valinit=1, facecolor='blue', 
alpha=0.5)
+samp = Slider(axamp, 'Amp', 0.1, 10.0, valinit=1, facecolor='red', alpha=0.5)
 
 def update(val):
     amp = samp.val

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2008-05-28 
18:19:30 UTC (rev 5294)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2008-05-28 
18:22:39 UTC (rev 5295)
@@ -719,6 +719,13 @@
                     charprocDict['Type'] = Name('XObject')
                     charprocDict['Subtype'] = Name('Form')
                     charprocDict['BBox'] = bbox
+                    # Each glyph includes bounding box information,
+                    # but xpdf and ghostscript can't handle it in a
+                    # Form XObject (they segfault!!!), so we remove it
+                    # from the stream here.  It's not needed anyway,
+                    # since the Form XObject includes it in its BBox
+                    # value.
+                    stream = stream[stream.find("d1") + 2:]
                 charprocObject = self.reserveObject('charProc')
                 self.beginStream(charprocObject.id, None, charprocDict)
                 self.currentstream.write(stream)

Modified: trunk/matplotlib/lib/matplotlib/widgets.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/widgets.py  2008-05-28 18:19:30 UTC (rev 
5294)
+++ trunk/matplotlib/lib/matplotlib/widgets.py  2008-05-28 18:22:39 UTC (rev 
5295)
@@ -171,7 +171,7 @@
     """
     def __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f',
                  closedmin=True, closedmax=True, slidermin=None, 
slidermax=None,
-                 dragging=True):
+                 dragging=True, **kwargs):
         """
         Create a slider from valmin to valmax in axes ax;
 
@@ -185,6 +185,11 @@
 
         slidermin and slidermax - be used to contrain the value of
           this slider to the values of other sliders.
+
+        additional kwargs are passed on to self.poly which is the
+        matplotlib.patches.Rectangle which draws the slider.  See the
+        matplotlib.patches.Rectangle documentation for legal property
+        names (eg facecolor, edgecolor, alpha, ...)
           """
         self.ax = ax
 
@@ -192,7 +197,7 @@
         self.valmax = valmax
         self.val = valinit
         self.valinit = valinit
-        self.poly = ax.axvspan(valmin,valinit,0,1)
+        self.poly = ax.axvspan(valmin,valinit,0,1, **kwargs)
 
         self.vline = ax.axvline(valinit,0,1, color='r', lw=1)
 


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to