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

Function _get_fontconfig_fonts

lib/matplotlib/font_manager.py:254–264  ·  view source on GitHub ↗

Cache and list the font paths known to ``fc-list``.

()

Source from the content-addressed store, hash-verified

252
253@cache
254def _get_fontconfig_fonts():
255 """Cache and list the font paths known to ``fc-list``."""
256 try:
257 if b'--format' not in subprocess.check_output(['fc-list', '--help']):
258 _log.warning( # fontconfig 2.7 implemented --format.
259 'Matplotlib needs fontconfig>=2.7 to query system fonts.')
260 return []
261 out = subprocess.check_output(['fc-list', '--format=%{file}\\n'])
262 except (OSError, subprocess.CalledProcessError):
263 return []
264 return [Path(os.fsdecode(fname)) for fname in out.split(b'\n')]
265
266
267@cache

Callers 2

findSystemFontsFunction · 0.85

Calls 1

PathClass · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…