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

Skip to content

Try to install the Noto Sans CJK font #20851

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

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ commands:
fonts-crosextra-carlito \
fonts-freefont-otf \
fonts-humor-sans \
fonts-noto-cjk \
optipng

fonts-install:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
cm-super \
dvipng \
ffmpeg \
fonts-noto-cjk \
gdb \
gir1.2-gtk-3.0 \
graphviz \
Expand Down Expand Up @@ -101,6 +102,8 @@ jobs:
;;
macOS)
brew install ccache
brew tap homebrew/cask-fonts
brew install font-noto-sans-cjk-sc
;;
esac

Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ stages:
cm-super \
dvipng \
ffmpeg \
fonts-noto-cjk \
gdb \
gir1.2-gtk-3.0 \
graphviz \
Expand All @@ -102,6 +103,8 @@ stages:
darwin)
brew install --cask xquartz
brew install pkg-config ffmpeg imagemagick mplayer ccache
brew tap homebrew/cask-fonts
brew install font-noto-sans-cjk-sc
;;
win32)
;;
Expand Down
17 changes: 14 additions & 3 deletions lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_utf16m_sfnt():
entry = next(entry for entry in fontManager.ttflist
if Path(entry.fname).name == "seguisbi.ttf")
except StopIteration:
pytest.skip("Couldn't find font to test against.")
pytest.skip("Couldn't find seguisbi.ttf font to test against.")
else:
# Check that we successfully read "semibold" from the font's sfnt table
# and set its weight accordingly.
Expand All @@ -111,14 +111,25 @@ def test_utf16m_sfnt():
def test_find_ttc():
fp = FontProperties(family=["WenQuanYi Zen Hei"])
if Path(findfont(fp)).name != "wqy-zenhei.ttc":
pytest.skip("Font may be missing")

pytest.skip("Font wqy-zenhei.ttc may be missing")
fig, ax = plt.subplots()
ax.text(.5, .5, "\N{KANGXI RADICAL DRAGON}", fontproperties=fp)
for fmt in ["raw", "svg", "pdf", "ps"]:
fig.savefig(BytesIO(), format=fmt)


def test_find_noto():
fp = FontProperties(family=["Noto Sans CJK SC", "Noto Sans CJK JP"])
name = Path(findfont(fp)).name
if name not in ("NotoSansCJKsc-Regular.otf", "NotoSansCJK-Regular.ttc"):
pytest.skip(f"Noto Sans CJK SC font may be missing (found {name})")

fig, ax = plt.subplots()
ax.text(0.5, 0.5, 'Hello, 你好', fontproperties=fp)
for fmt in ["raw", "svg", "pdf", "ps"]:
fig.savefig(BytesIO(), format=fmt)


def test_find_invalid(tmpdir):
tmp_path = Path(tmpdir)

Expand Down