On Wednesday, November 24, 2010, Daniel Hyams <dhy...@gmail.com> wrote:
> MPL 1.0.0, OSX
> If USE_FONTCONFIG is turned on, the function 
> FontProperties.get_size_in_points will sometimes fail, because it is wanting 
> to use "fontManager", which is still 'None' if USE_FONTCONFIG is on.  I'm not 
> sure if it's the proper way to fix it, but here is a small patch that works 
> (meaning that at least the code doesn't die; I can't vouch for much else):
>
>
> ORIGINAL:
>     def get_size_in_points(self):        if self._size is not None:           
>  try:                return float(self._size)
>
>             except ValueError:                pass        default_size = 
> fontManager.get_default_size()        return default_size * 
> font_scalings.get(self._size)
>
>
> NEW:
>     def get_size_in_points(self):        if self._size is not None:           
>  try:                return float(self._size)            except ValueError:
>
>                 pass        if fontManager:            default_size = 
> fontManager.get_default_size()        else:           default_size = 
> rcParams['font.size']
>
>         return default_size * font_scalings.get(self._size)
>
> --
> Daniel Hyams
> dhy...@gmail.com
>
>

I personally think that this is reasonable, as it guarantees a size
value to come from somewhere.  However, I am concerned about
fontManager being None. If it isn't a bug for it to be None at this
point, then I have to wonder where-else in the code needs a check for
None?  If it is a bug, then what should it be when USE_FONTCONFIG is
true?

Good catch Daniel.

Ben Root

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to