Revision: 6956
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6956&view=rev
Author:   leejjoon
Date:     2009-03-05 04:45:00 +0000 (Thu, 05 Mar 2009)

Log Message:
-----------
hashing of FontProperties accounts current rcParams

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/font_manager.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-03-04 20:53:29 UTC (rev 6955)
+++ trunk/matplotlib/CHANGELOG  2009-03-05 04:45:00 UTC (rev 6956)
@@ -1,3 +1,5 @@
+2009-02-28 hashing of FontProperties accounts current rcParams - JJL
+
 2009-02-28 Prevent double-rendering of shared axis in twinx, twiny - EF
 
 2009-02-26 Add optional bbox_to_anchor argument for legend class - JJL

Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py     2009-03-04 20:53:29 UTC 
(rev 6955)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py     2009-03-05 04:45:00 UTC 
(rev 6956)
@@ -705,10 +705,9 @@
         return parse_fontconfig_pattern(pattern)
 
     def __hash__(self):
-        l = self.__dict__.items()
-        l.sort()
+        l = [(k, getattr(self, "get" + k)()) for k in sorted(self.__dict__)]
         return hash(repr(l))
-
+ 
     def __str__(self):
         return self.get_fontconfig_pattern()
 
@@ -1181,7 +1180,7 @@
         """
         debug = False
         if prop is None:
-            return self.defaultFont
+            prop = FontProperties()
         if is_string_like(prop):
             prop = FontProperties(prop)
         fname = prop.get_file()


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

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to