Le Mar 9 juillet 2013 15:14, Nicolas Mailhot a écrit :
>
> Le Lun 8 juillet 2013 18:18, Martin Mokrejs a écrit :
>> Could you instead just test for "if not self._family"? Tests for
>> equality
>> are more expensive (that means self._family == 0 or self._family ==
>> False
>> will also trigger your return).
>
> I can test if it works. However, all the other tests in that file are
> already of the if Foo is None form, and I didn't want to change the coding
> style
And I can confirm the following patch also fixes my workload
diff -uNr matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
matplotlib-1.2.1/lib/matplotlib/font_manager.py
--- matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py 2013-03-26
14:04:37.000000000 +0100
+++ matplotlib-1.2.1/lib/matplotlib/font_manager.py 2013-07-08
14:49:37.791845661 +0200
@@ -721,6 +721,8 @@
Return the name of the font that best matches the font
properties.
"""
+ if not self._family:
+ return rcParams['font.family'][0]
return ft2font.FT2Font(str(findfont(self))).family_name
def get_style(self):
Now could something similar be merged?
Regards,
--
Nicolas Mailhot
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users