Nearest neighbor search for font lookup

I've finally gotten around to addressing a long-standing pet peeve of mine. The font lookup is now performed with a nearest neighbor search, so if an exact font match can not be found for what the user specifies, the best available match is used, rather than dropping down to Vera Sans. This is particularly important with fonts we don't distribute (particularly high-end commercial fonts) that have unusual values for "bold" etc.

All the examples in the docs and backend_driver seem to pass (with no required changes), so I've committed my patch. But I wouldn't be surprised if some external usage may behave differently, particularly if it was relying on the old broken behavior. Please test any scripts you may have that use different fonts (those not included with matplotlib especially) and report any regressions.



Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA