Skip to content

Commit 1580324

Browse files
jeremymanningclaude
andcommitted
feat(slides): Add CJK font support for Chinese characters in PDFs
- Add Noto Sans SC variable font for Chinese character rendering - Update cdl-theme.css with @font-face for Noto Sans SC - Add 'Noto Sans SC' to all font-family stacks as CJK fallback - Regenerate lecture1.pdf with proper Chinese character display Fixes Chinese characters (你好吗, 我很好, 你) in The Chinese Room worked example slide that were not rendering in PDF output. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e40cab5 commit 1580324

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed
16.9 MB
Binary file not shown.

slides/template_deck/themes/cdl-theme.css

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
--chart-axis-color: #0a2518;
9797

9898
/* Font stacks for charts */
99-
--chart-font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;
99+
--chart-font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
100100
}
101101

102102
/* Local font face definitions for Avenir - including italic variants */
@@ -154,6 +154,14 @@
154154

155155
/* Note: BlackOblique variant not available - browser will synthesize italic */
156156

157+
/* Noto Sans SC for CJK (Chinese) character support in PDFs */
158+
@font-face {
159+
font-family: 'Noto Sans SC';
160+
src: url('../../fonts/NotoSansSC-VariableFont_wght.ttf') format('truetype');
161+
font-weight: 100 900;
162+
font-style: normal;
163+
}
164+
157165
/* FiraCode local font face */
158166
@font-face {
159167
font-family: 'Fira Code Local';
@@ -334,36 +342,36 @@ pre code.has-line-numbers .line-code {
334342

335343
/* Headings - base styling only, font-size set per slide type */
336344
h1 {
337-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
345+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
338346
/* font-size set in title slide and content slide sections */
339347
}
340348

341349
h2 {
342-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
350+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
343351
font-size: 1.3em;
344352
font-weight: 700;
345353
}
346354

347355
h3 {
348-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
356+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
349357
font-size: 1.1em;
350358
font-weight: 500;
351359
}
352360

353361
h4 {
354-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
362+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
355363
font-size: 1em;
356364
font-weight: 500;
357365
}
358366

359367
h5 {
360-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
368+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
361369
font-size: 0.9em;
362370
font-weight: 500;
363371
}
364372

365373
h6 {
366-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
374+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
367375
font-size: 0.8em;
368376
font-weight: 500;
369377
}
@@ -377,7 +385,7 @@ blockquote {
377385
margin: 1em auto 0;
378386
padding: 0.5em 2em;
379387
position: relative;
380-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
388+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
381389
font-size: 1.1em;
382390
font-style: italic;
383391
font-weight: 400;
@@ -396,7 +404,7 @@ blockquote::before {
396404
left: -0.3em;
397405
top: -0.2em;
398406
font-size: 3em;
399-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
407+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
400408
font-weight: 600;
401409
color: rgba(0, 105, 62, 0.15);
402410
line-height: 1;
@@ -409,7 +417,7 @@ blockquote::after {
409417
right: -0.1em;
410418
bottom: -0.5em;
411419
font-size: 3em;
412-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
420+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
413421
font-weight: 600;
414422
color: rgba(0, 105, 62, 0.15);
415423
line-height: 1;
@@ -429,7 +437,7 @@ table {
429437
border-collapse: collapse;
430438
margin: 0.5em auto 0;
431439
font-size: 0.7em;
432-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
440+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
433441
border: 3px solid #0a2518;
434442
width: 95%;
435443
max-width: 95%;
@@ -503,7 +511,7 @@ section {
503511
background-color: #d8d8d8;
504512
color: #0a2518;
505513
font-size: 35px;
506-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
514+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
507515
font-weight: 400;
508516
height: 720px;
509517
line-height: 1.35;
@@ -1211,7 +1219,7 @@ table.table-continuation {
12111219
border-collapse: collapse;
12121220
margin: 0.5em auto 0;
12131221
font-size: 0.7em;
1214-
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', sans-serif;
1222+
font-family: 'Avenir LT Std', 'Avenir', 'Avenir Next', 'Noto Sans SC', sans-serif;
12151223
border: 3px solid #0a2518;
12161224
width: 95%;
12171225
max-width: 95%;

slides/week1/lecture1.pdf

6.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)