8000 Don't attempt to load system fonts on Emscripten · matplotlib/matplotlib@522c318 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 522c318

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 ee446a0 commit 522c318

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
@@ -287,6 +287,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
287287
if sys.platform == 'win32':
288288
installed_fonts = _get_win32_installed_fonts()
289289
fontpaths = []
290+
elif sys.platform == 'emscripten':
291+
installed_fonts = []
292+
fontpaths = []
290293
else:
291294
installed_fonts = _get_fontconfig_fonts()
292295
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
@@ -20,7 +20,7 @@
2020
from matplotlib.testing import subprocess_run_helper, subprocess_run_for_testing
2121

2222

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

2525

2626
def test_font_priority():

0 commit comments

Comments
 (0)
0