Files
curriculum-project-hub/render/src/fonts.typ
T
sjfhsjfh c17af60bb0 feat(render): rebuild typst render package cph-render (WU-2)
Single entry `display(info, target, parts)` over an ordered parts array, the
frozen contract the generated typst driver calls. Per-kind dispatch for
segment/example/lemma/sop; student/teacher matrix derived internally from
`target` (student hides example solution + lemma proof; teacher shows all).
Content-field values are consumed as already-evaluated content (driver
`include`s them ⇒ module body, ADR-0006), never imported/stringified. Optional
fields (lemma proof, example source) handled gracefully; unknown kind/target
degrade without crashing. Zero @preview deps (CI-robust); CJK + math styled.
Smoke compiles to non-empty student/teacher PDFs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 01:33:40 +08:00

17 lines
855 B
Typst

// Font families. The lesson text is Chinese + heavy math.
//
// We pass FONT FALLBACK LISTS rather than single names: typst tries each in
// order and falls back to the next if a face is missing. This means we never
// hard-fail when one specific CJK font is absent on the compile host — a key
// MVP robustness requirement (CI may have a different font set).
/// Serif body font (宋体). First broadly-shipped match wins; if none are
/// present typst falls back to its own default — we never hard-fail.
#let serif = ("Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun")
/// Sans / heading font (黑体).
#let sans = ("Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Heiti SC", "SimHei")
/// Accent font used for problem/proof bodies (仿宋 feel).
#let accent = ("FZFangSong-Z02S", "FangSong", "STFangsong", "Songti SC")