Skip to content

Commit 37502fa

Browse files
authored
Make font search case insensitive in logo example
Made check lowercase b/c on windows findfont returns a lowercase file name string such that the if statements can't evaluate true.
1 parent a85564e commit 37502fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

galleries/examples/misc/logos2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
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+
if 'carlito' in matplotlib.font_manager.findfont('Carlito:bold').lower():
2828
print('Original font not found. Falling back to Carlito. '
2929
'The logo text will not be in the correct font.')
3030
return matplotlib.font_manager.FontProperties(family='Carlito',

0 commit comments

Comments
 (0)