Skip to content

Commit 4f49ce6

Browse files
committed
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.
1 parent 113e581 commit 4f49ce6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
291291
if sys.platform == 'win32':
292292
installed_fonts = _get_win32_installed_fonts()
293293
fontpaths = []
294+
elif sys.platform == 'emscripten':
295+
installed_fonts = []
296+
fontpaths = []
294297
else:
295298
installed_fonts = _get_fontconfig_fonts()
296299
if sys.platform == 'darwin':

lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from matplotlib.testing import subprocess_run_helper, subprocess_run_for_testing
2222

2323

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

2626

2727
def test_font_priority():

0 commit comments

Comments
 (0)