From: <md...@us...> - 2007-09-20 12:31:27
|
Revision: 3861 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3861&view=rev Author: mdboom Date: 2007-09-20 05:31:26 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Fix font.size from being saved in the fontManager.cache Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/font_manager.py Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2007-09-19 19:48:17 UTC (rev 3860) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2007-09-20 12:31:26 UTC (rev 3861) @@ -773,6 +773,7 @@ else: if is_string_like(size): parent_size = fontManager.get_default_size() + print "parent_size", parent_size, size scaling = font_scalings.get(size) if scaling is not None: size = parent_size * scaling @@ -843,10 +844,9 @@ """ def __init__(self, size=None, weight='normal'): - if not size : size = rcParams['font.size'] - self.__default_size = size self.__default_weight = weight - + self.default_size = size + paths = [os.path.join(rcParams['datapath'],'fonts','ttf'), os.path.join(rcParams['datapath'],'fonts','afm')] @@ -899,7 +899,9 @@ def get_default_size(self): "Return the default font size." - return self.__default_size + if self.default_size is None: + return rcParams['font.size'] + return self.default_size def set_default_weight(self, weight): "Set the default font weight. The initial value is 'normal'." @@ -1085,6 +1087,7 @@ try: fontManager = pickle_load(_fmcache) + fontManager.default_size = None verbose.report("Using fontManager instance from %s" % _fmcache) except: _rebuild() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |