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
------------------------------------------------------------------------------
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