Make font search case insensitive in logo example#31385
Conversation
Made check lowercase b/c on windows findfont returns a lowercase file name string such that the if statements can't evaluate true.
|
Feel free to self-merge if you think the test failures are spurious (I assume they are) |
Is there something wrong with the doc page? If you mean the warning, Calibri isn't available on Linux and we don't try to install it on Circle, so it should be falling back to Carlito.. |
I feel like we should be using our logo font in our canonical logo example |
|
🤷 Then we shouldn't have used a proprietary font that prevents us from doing so. |
explain why the web docs are using the fallback, mostly to demystify why we're showing an example that is displaying an error like message.
|
Added a second commit explaining why fallback b/c I think it's not great to have an unexplained what looks like an error message like message in published docs. |
PR summary
findfontreturns a lowercase filepath such that on windows the check for the font will always return false. So I put the entire check into lowercase. I'm sure there are probably better/more efficient ways to do this, but I'd save that for a rework of this whole page. My guess is that this is also what's going wrong on the docs page: https://matplotlib.org/devdocs/gallery/misc/logos2.htmlAlso b/c I was using the gui, I made the patch branch here instead of on my fork. 🤦♀️ sorry!
AI Disclosure
nope
PR checklist