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

Function _load_fontmanager

lib/matplotlib/font_manager.py:1833–1848  ·  view source on GitHub ↗
(*, try_read_cache=True)

Source from the content-addressed store, hash-verified

1831
1832
1833def _load_fontmanager(*, try_read_cache=True):
1834 fm_path = Path(
1835 mpl.get_cachedir(), f"fontlist-v{FontManager.__version__}.json")
1836 if try_read_cache:
1837 try:
1838 fm = json_load(fm_path)
1839 except Exception:
1840 pass
1841 else:
1842 if getattr(fm, "_version", object()) == FontManager.__version__:
1843 _log.debug("Using fontManager instance from %s", fm_path)
1844 return fm
1845 fm = FontManager()
1846 json_dump(fm, fm_path)
1847 _log.info("generated new fontManager")
1848 return fm
1849
1850
1851fontManager = _load_fontmanager()

Callers 2

_findfont_cachedMethod · 0.85
font_manager.pyFile · 0.85

Calls 4

PathClass · 0.85
json_loadFunction · 0.85
FontManagerClass · 0.85
json_dumpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…