Commit 34be2ea
Fix the live tofu in jax_intro, without trading it for subscript tofu (#78)
* Restore CJK font configuration in jax_intro
The PRNG key-splitting figure sets a Chinese axis title ("PRNG 密钥拆分树"),
but this lecture never registers a CJK font. matplotlib therefore falls
back to DejaVu Sans, which has no CJK coverage, and the title renders as
blank boxes ("tofu"). Nothing errors and a valid PNG is written, so the
defect is silent -- it only shows up in the published output.
Adds this edition's standard font block to the existing import cell,
immediately after the matplotlib import, so it runs before any figure is
drawn. The block is byte-for-byte identical to the one already carried by
debugging.md, numba.md and the other 15 lectures in this repo, and the
font path resolves to the tracked asset lectures/_fonts/SourceHanSerifSC-SemiBold.otf.
See #77
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add a DejaVu fallback so the font block does not trade one tofu for another
jax_intro's figure labels the split tree with key₀, key₁, subkey₁ ... and a
vertical ellipsis. Source Han Serif SC follows Adobe-GB1 and contains none of
U+2080-2083 or U+22EE, so registering it as the sole font.family entry would
have fixed the title (5 CJK characters) while breaking 8 label glyphs that
render correctly today — a wash at best, and silent either way.
Measured on matplotlib 3.11.1 against this repo's own font:
font.family = ['Source Han Serif SC'] -> 4 missing-glyph warnings
font.family = ['Source Han Serif SC', 'DejaVu Sans'] -> 0
Deliberately deviates from the single-entry dialect used elsewhere here.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d13992d commit 34be2ea
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
0 commit comments