Skip to content

Commit 9e38f54

Browse files
authored
Merge pull request matplotlib#31385 from matplotlib/logo-fontsearch
Make font search case insensitive in logo example
2 parents 7c54133 + 6d2d934 commit 9e38f54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

galleries/examples/misc/logos2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
def get_font_properties():
2222
# The original font is Calibri, if that is not installed, we fall back
2323
# to Carlito, which is metrically equivalent.
24-
if 'Calibri' in matplotlib.font_manager.findfont('Calibri:bold'):
24+
if 'calibri' in matplotlib.font_manager.findfont('Calibri:bold').lower():
2525
return matplotlib.font_manager.FontProperties(family='Calibri',
2626
weight='bold')
27-
if 'Carlito' in matplotlib.font_manager.findfont('Carlito:bold'):
27+
# Our website documentation uses Carlito because Calibri is proprietary.
28+
if 'carlito' in matplotlib.font_manager.findfont('Carlito:bold').lower():
2829
print('Original font not found. Falling back to Carlito. '
2930
'The logo text will not be in the correct font.')
3031
return matplotlib.font_manager.FontProperties(family='Carlito',

0 commit comments

Comments
 (0)