8000 support ttc fonts · Issue #8612 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

support ttc fonts #8612

New issue

Have a question about thi 8000 s 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
jdhao opened this issue May 12, 2017 · 1 comment
Closed

support ttc fonts #8612

jdhao opened this issue May 12, 2017 · 1 comment

Comments

@jdhao
Copy link
jdhao commented May 12, 2017

I am trying to use Chinese text in my plot. There are some pre-installed font on the system which support Chinese (using fc-list :lang=zh), for example "WenQuanYi Zen Hei". But I find that these fonts can not be found by matplotlib. I checked some of the code of font_manager. I find that font_manger seems intentionally avoid finding font files in ttc extensions.

In order to use these font, I have to explicitly give the path of the font, like the following example code:

import matplotlib.pyplot as plt
import matplotlib.font_manager as mfm
ch_font = mfm.FontProperties(fname="/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc")
plt.annotate(xy=(0.5, 0.5), s=u'测试', xycoords='axes fraction', fontproperties=ch_font)
plt.show()

What is the reason behind this ?

Matplotlib version

  • Operating System: CentOS 7.2
  • Matplotlib Version: 2.0.1
  • Python Version: 3.6
@tacaswell tacaswell added this to the 2.2 (next next feature release) milestone May 12, 2017
@tacaswell tacaswell changed the title Why are some of the font found by fc-list are not found or used by matplotlib ? support ttc fonts May 12, 2017
@tacaswell
Copy link
Member

Closing as duplicate of #3135 which #3912 and #5414 attempt to fix.

@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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

3 participants
0