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

Skip to content

[bug] segmentation fault when try to savefig a pdf with Chinese font #19469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Freed-Wu opened this issue Feb 6, 2021 · 1 comment
Closed

Comments

@Freed-Wu
Copy link

Freed-Wu commented Feb 6, 2021

Environment

  • linux 5.4.13
  • python 3.9.0b3
  • ipython 7.19.0
  • matplotlib 3.3.3
  • texlive 2019-r1 (maybe useful)
  • qt 5.15.0 (maybe useful)
  • jupter 1.0.0-r2 (but i use ipython in terminal not jupyter)

Reproduce Procedures

%matplotlib qt
import matplotlib.pyplot as plt
fig,ax=plt.subplots(1,1)
ax.set_xlabel('测试',fontdict={'family': 'WenQuanYi Micro Hei'})
plt.savefig('a.pdf')
[1]    50554 segmentation fault (core dumped)  ipython

Note

WenQuanYi Micro Hei is a open source chinese font and can be installed by
sudo emerge -av media-fonts/wqy-microhei in my distribution. replacing it
with any Chinese font will result in the same bug. if replace it with any
non-Chinese font will not output Chinese character and avoid the bug.

if the picture format is png, the bug will not occur, and the file a.png
will be normal.

@anntzer
Copy link
Contributor

anntzer commented Feb 6, 2021

Thanks for the report.
I believe this is fixed by #18181 in the soon-to-be-released Matplotlib 3.4. Feel free to request a reopen if that issue persists after that patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants