FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Try to install the Noto Sans CJK font by jkseppan · Pull Request #20851 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .yml  (3) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions .circleci/config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL