Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ccad9c

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 b8ff3db commit 4ccad9c

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

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)