Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Bug]: FontManager doesn't get pinging.ttc #27705

Closed as not planned
Closed as not planned
@Artoria2e5

Description

@Artoria2e5

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.

test

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp