MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / get_font_properties

Function get_font_properties

galleries/examples/misc/logos2.py:21–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def get_font_properties():
22 # The original font is Calibri, if that is not installed, we fall back
23 # to Carlito, which is metrically equivalent.
24 if 'calibri' in matplotlib.font_manager.findfont('Calibri:bold').lower():
25 return matplotlib.font_manager.FontProperties(family='Calibri',
26 weight='bold')
27 # Our website documentation uses Carlito because Calibri is proprietary.
28 if 'carlito' in matplotlib.font_manager.findfont('Carlito:bold').lower():
29 print('Original font not found. Falling back to Carlito. '
30 'The logo text will not be in the correct font.')
31 return matplotlib.font_manager.FontProperties(family='Carlito',
32 weight='bold')
33 print('Original font not found. '
34 'The logo text will not be in the correct font.')
35 return None
36
37
38def create_icon_axes(fig, ax_position, lw_bars, lw_grid, lw_border, rgrid):

Callers 1

create_text_axesFunction · 0.85

Calls 1

findfontMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…