Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed as not planned
Description
Bug summary
/System/Library/Fonts/PingFang.ttc
is the macOS default Chinese font. The file is a collection of three family names representing three regional glyph variants, PingFang SC, PingFang HK, and PingFang TC. FontManager doesn't seem to be able to find the SC family inside; I haven't tried the others yet.
(Manually constructing a fontProperties works, as demonstrated in#20251 (comment). However, it's not a solution for well-encapsulated code from other people.)
Code for reproduction
importmatplotlibimportmatplotlib.pyplotaspltmatplotlib.rcParams['font.family']= ['Ubuntu','PingFang SC','sans-serif']plt.title('你好世界world')plt.savefig("test.png")
Actual outcome
indfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found./private/tmp/1.py:5: UserWarning: Glyph 20320 (\N{CJK UNIFIED IDEOGRAPH-4F60}) missing from current font. plt.savefig("test.png")/private/tmp/1.py:5: UserWarning: Glyph 22909 (\N{CJK UNIFIED IDEOGRAPH-597D}) missing from current font. plt.savefig("test.png")/private/tmp/1.py:5: UserWarning: Glyph 19990 (\N{CJK UNIFIED IDEOGRAPH-4E16}) missing from current font. plt.savefig("test.png")/private/tmp/1.py:5: UserWarning: Glyph 30028 (\N{CJK UNIFIED IDEOGRAPH-754C}) missing from current font. plt.savefig("test.png")findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.findfont: Font family 'PingFang SC' not found.
Expected outcome
The text should not be thin rectangles.
Additional information
No response
Operating system
macOS
Matplotlib Version
3.8.2
Matplotlib Backend
MacOSX
Python version
Python 3.11.6
Jupyter version
No response
Installation
pip
Metadata
Metadata
Assignees
Labels
No labels