Commit 9c8b6d2d authored by Michael Droettboom's avatar Michael Droettboom

Fix #305: Fix PDF export from matplotlib

parent 7ecb6b73
......@@ -29,7 +29,7 @@ LDFLAGS=\
-s EMULATE_FUNCTION_POINTER_CASTS=1 \
-s LINKABLE=1 \
-s EXPORT_ALL=1 \
-s EXPORTED_FUNCTIONS='["___cxa_guard_acquire"]' \
-s EXPORTED_FUNCTIONS='["___cxa_guard_acquire", "__ZNSt3__28ios_base4initEPv"]' \
-s WASM=1 \
-s SWAPPABLE_ASM_MODULE=1 \
-s USE_FREETYPE=1 \
......
......@@ -16,3 +16,15 @@ def test_svg(selenium):
content = selenium.run("fd.getvalue().decode('utf8')")
assert len(content) == 15752
assert content.startswith("<?xml")
def test_pdf(selenium):
selenium.load_package("matplotlib")
selenium.run("from matplotlib import pyplot as plt")
selenium.run("plt.figure()")
selenium.run("x = plt.plot([1,2,3])")
selenium.run("import io")
selenium.run("fd = io.BytesIO()")
selenium.run("plt.savefig(fd, format='svg')")
content = selenium.run("fd.getvalue()")
assert len(content) == 15752
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment