Skip to content
Prev Previous commit
Next Next commit
Don't attempt to load system fonts on Emscripten
The file system is either sandboxed or there are simply no other fonts,
so limit ourselves to our pre-shipped fonts.
  • Loading branch information
QuLogic committed Mar 19, 2026
commit 4ccad9c74b2e935d2f66826029c3493d2e757189
3 changes: 3 additions & 0 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
if sys.platform == 'win32':
installed_fonts = _get_win32_installed_fonts()
fontpaths = []
elif sys.platform == 'emscripten':
installed_fonts = []
fontpaths = []
else:
installed_fonts = _get_fontconfig_fonts()
if sys.platform == 'darwin':
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from matplotlib.testing import subprocess_run_helper, subprocess_run_for_testing


has_fclist = shutil.which('fc-list') is not None
has_fclist = sys.platform != 'emscripten' and shutil.which('fc-list') is not None


def test_font_priority():
Expand Down