Three lectures render Chinese plot labels as tofu — no matplotlib font configuration
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- markdown, matplotlib, python
調査の方向性
divergence_measures.md、kesten_processes.md、jv.md を調査し、それぞれの plotting セクションを、エディションの標準フォントブロックをすでに使用している 103 講義と比較してください。lectures/fonts/SourceHanSerifSC-SemiBold.otf の asset を確認し、影響を受ける図を render してください。3 つすべての講義で plotting 前にそのフォントを設定し、中国語のラベルが tofu なしで render されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Three lectures set Chinese text on matplotlib figures but carry no font configuration, so matplotlib falls back to DejaVu Sans, which has no CJK coverage. The labels render as tofu — blank rectangles — in a valid PNG, and nothing fails.
| Lecture | Chinese plot text | How it broke |
|---|---|---|
divergence_measures.md |
7 sites, e.g. plt.ylabel('密度'), axes[0].set_xlabel('KL散度 KL(f, g)') |
never had a block; labels hand-added 2025-09-12, after the blanket font pass |
kesten_processes.md |
4 sites, e.g. ax.set_ylabel("收益率"), ax.set_xlabel("日期") |
regression — block deleted by resync da7b176 (#190), labels kept |
jv.md |
via titles = [r"$s$策略", r"$\phi$策略", "价值函数"] |
block stripped by resync |
Fix
Add the edition's standard block to each, above first plotting use:
FONTPATH = "fonts/SourceHanSerifSC-SemiBold.otf"
mpl.font_manager.fontManager.addfont(FONTPATH)
plt.rcParams['font.family'] = ['Source Han Serif SC']
Note fonts/, not _fonts/ — this edition keeps the asset at lectures/fonts/SourceHanSerifSC-SemiBold.otf and the other 103 configured lectures all use that path.
Context
Not yet visible to readers: this edition last published 2025-11-06 and the breakage is post-dated, so the live site still serves pre-resync content. That is timing, not safety — it ships on the next publish.
Root cause and the recommendation against reverting to usetex are in the program review: project-translation reports/2026-07-24-cjk-font-rendering-review.md. Engine side is action-translation#107 — the resync drops i18n adaptations. A further ~12 lectures here use matplotlib with English labels and no config, which becomes tofu the moment anyone localises a label.
CI cannot currently catch any of this: the missing-glyph warning is raised in the kernel subprocess, so -W never sees it.
- 主要言語
- TeX
- スター
- 5
- フォーク
- 4
- 平均マージ
- 18時間 24分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantEcon/lecture-python.zh-cn のほかの issue
-
Phase 2 tidy-up: revert intersphinx-qualified references once their target lectures are translatedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
QuantEcon/lecture-python.zh-cn#173 · コメント 2 件 ·
-
The -W gate is blind in ci.yml, and a warning-only cache failure discards a completed executionオープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
QuantEcon/lecture-python.zh-cn#271 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
QuantEcon/lecture-python.zh-cn#266 · コメント 4 件 ·
QuantEcon/lecture-python.zh-cn の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
datacarpentry/semester-biology#1265 ·
メンテナーはふだん 1 日以内に返信
-
Pivot table reports/exports pick an arbitrary metric for a mixed-metric total instead of blanking itオープンpreset-io
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
E3SM-Project/e3sm_diags#1093 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信