简单来说
日本读者学习古汉语的方式:字旁的红色小记号告诉读者按什么顺序读、加上哪些日文词尾,每段后面跟着完整的日文读法。
成品一览
一本日本学校汉文(漢文,kanbun)读本的三页,也就是当作日文来读的古汉语,A5页面,右侧装订:三则《论语》和孟浩然的绝句《春晓》。每段用15 pt的Zen Old Mincho按汉语原来的语序排,字旁用朱色标出训点(訓点,kunten),字号为正文的一半:字左下方的返り点(kaeriten)告诉读者先往下读、再回到这个字,字右侧的送り仮名(okurigana)补上日文的词尾。每段之下是它的書き下し文(yomikudashi),即把同一段文字写成日文,用课本手写体Klee One,难读处标振假名。带有自身阅读辅助的中文经典见Nº 080。
这道食谱解答
- 怎样排印带返点和送假名的汉文?
- 怎样在汉字上加振假名,是一字一音还是整个词一个读音?
简短回答
// :kunten[習]{kaeri="レ" okuri="フ"} sets the return mark small at the character's lower
// left and the okurigana at its lower right, down the line; the text keeps its Chinese
// order, which the reader follows by the marks. cjk.kunten sizes and colours them: half
// the character, in vermilion. The Japanese reading under each passage is plain kana and
// kanji with furigana: {君子|くん|し} gives each character its reading (jukugo ruby).
const cjk = {
grid: { enabled: true, charsPerLine: CHARS, linesPerPage: LINES },
kunten: { fontSize: em(0.5), color: col('vermilion'), placement: 'inline' },
};
const paragraphStyles = [
// The text: 15 pt on a pitch of two grid lines, room for the okurigana beside it. A
// quatrain takes two lines, a couplet to the line with a space between its verses.
{ id: 'kanbun', fontFamily: MINCHO, fontSize: pt(KANBUN), lineHeight: pt(2 * LEAD),
firstLineIndent: em(0), textAlign: 'justify' },
{ id: 'shi', fontFamily: MINCHO, fontSize: pt(KANBUN), lineHeight: pt(2 * LEAD),
indent: em(2), firstLineIndent: em(0), marginTop: pt(0), marginBottom: pt(0) },
// The reading (書き下し文), two characters down in a school-book hand.
{ id: 'kudashi', indent: em(2), firstLineIndent: em(0), marginTop: pt(LEAD) },
{ id: 'kudashi-shi', indent: em(4), firstLineIndent: em(0), marginTop: pt(0),
marginBottom: pt(0) },
];
用料
做法
#1 · 用:kunten标注每个字
代码见上文的简短回答。:kunten[習]{kaeri="レ" okuri="フ"}给習加上返り点レ和送り仮名フ;正文仍是这个字,所以检索、复制和PDF都按原文读这一段,训点不占正文的任何字符(着重号、注音与夹注)。读作学ビテ而時ニ習フレ之ヲ:習上的レ让读者先读之再回来,即之を習ふ;而没有训点,不读。竖排时,返り点位于所属字的左下方,在行内占半个字;送り仮名位于右侧,从字的一半高度开始,这是JIS X 4051的排法。cjk.kunten设定它们的字号(正文的一半)和颜色(读者书写训点用的朱色);一段是排在网格两行上的15 pt字,每行旁边留出27 pt给送り仮名。
#2 · 用一二点和一レ点跳读
数字让读者往回跳得更远。在不二亦タ説バシカラ一乎中,读者跳过带二的不,读亦た説ばしから,到一处再回到上面的不:亦た説ばしからずや。在《为政》中,為上的合用记号一レ兼有两种作用:可二以テ為一レ師ト矣读作以て、師と(レ)、為る,再回到可(从一到二),即以て師と為るべし。汉文训读符号的码位㆑㆒㆓按它们所代表的字来读,所以从别处复制来的文本保留着它的训点。
#3 · 让长的送り仮名把下一个字往后推
比所属字长的送り仮名不会伸到下一个字的旁边:在花落ツルコト知ル多少中,ツルコト四个假名占两个字的长度,知往下移,从它们之后开始,这是JIS X 4051的排法(§5.6.4)。这一行因此变长,下一个断行点随之移动。
#4 · 每段配一个两行高的标签
const at = (down, across) => ({ anchor: { to: 'container', edge: 'top-left' },
offset: { x: pt(down), y: pt(across) } });
const TITLE = 26; // pt
const part = { level: 1, breakBefore: { enabled: true, parity: 'any' },
advancedDesign: { enabled: true, minHeight: pt(5 * LEAD), slot: { elements: [
{ kind: 'text', id: 'title', content: '{titleText}', fontFamily: MINCHO, fontWeight: 700,
fontSize: pt(TITLE), lineHeight: 1, letterSpacing: pt(TITLE / 2), color: col('ink'),
placement: at(2 * BODY, 2 * LEAD - TITLE / 2) },
{ kind: 'text', id: 'kicker', content: '{attr.kicker}', fontFamily: GOTHIC, fontSize: pt(8.5),
letterSpacing: pt(2), color: col('vermilion'), placement: at(2 * BODY + 3 * TITLE + 18,
2 * LEAD - 8.5 / 2) },
] } } };
// 2行取り, the passage's book and number in gothic, two characters down.
const passage = { level: 2, fontFamily: GOTHIC, fontWeight: 700, fontSize: pt(9.5),
color: col('muted'), lineSpan: 2, indent: em(2) };
读本的每一部分以书名论语或唐诗另起一页,前者带一条朱色小字,说明其中收了什么;每段配一个黑体标签,宽两个正文行(2行取り),如学而第一或春暁 孟浩然,所以下面的段落仍在网格上。读法是一个:::paragraphs{style="kudashi"}围栏,低两字,用正文的字体和字号,振假名采用熟语注音:{君子|くん|し}给每个字各自的读音,所以一行可以在两字之间断开。
#5 · 每种字体只加载它要排的字
const FENCE = /:::paragraphs\{style="([\w-]+)"\}\n([\s\S]*?)\n:::/g;
const fence = (style) => [...markdown.matchAll(FENCE)].filter((m) => m[1] === style)
.map((m) => m[2]).join('');
const kanbun = `${fence('kanbun')}${fence('shi')}`; // the text and its marks' kana
const reading = `${fence('kudashi')}${fence('kudashi-shi')}`;
const heads = markdown.match(/^#+ [^{\n]*/gm).join('');
const colophon = markdown.match(/colophon="([^"]*)"/)[1];
await loadFonts(FONTS, markdown); // the Latin files: the colophon
await loadCjkFonts({ [MINCHO]: ['400'] }, kanbun, { vertical: true });
await loadCjkFonts({ [MINCHO]: ['700'] }, heads);
await loadCjkFonts({ [KYOKASHO]: ['400'] }, reading, { vertical: true });
await loadCjkFonts({ [GOTHIC]: ['400', '700'] },
`${heads}${colophon}${markdown.match(/kicker="([^"]*)"/)[1]}漢文訓読一二三四五六七八九十`,
{ vertical: true });
汉文原文和读法用不同的字体排,所以各自只加载自己文字所需的文件:Zen Old Mincho排原文和训点,训点的假名写在:kunten的属性里;Klee One排读法和它的振假名;Noto Sans JP排标签。绝句每行排两句,中间隔一个全角空格,这是常见的印法,所以诗和它的读法都能排在标题下的一页里。
完整食谱
// ═══ Postext Cookbook · Nº 122 · Kanbun with its reading marks, and the Japanese reading ═══
// https://postext.dev/en/cookbook/kanbun-kundoku
// Code: MIT · Text: 論語, 孟浩然「春暁」 (public domain); kunten and readings CC BY 4.0
// Fonts: Zen Old Mincho, Klee One, Noto Sans JP (SIL OFL 1.1) · Needs postext ≥ 1.25.0
import {
buildDocument, withLoadedFonts, renderPageToCanvas, loadVerticalAlternates,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the colophon; the page is Japanese in both
const RECIPE = 'kanbun-kundoku';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: ink, the vermilion of hand-written kunten, a school-book paper
const palette = {
ink: '#1e1c1a', // the text
vermilion: '#c0392b', // 朱: the reading marks, as a reader adds them by hand
muted: '#6a635c', // the headings' labels, the folios
paper: '#fcfbf7',
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
{ id: 'main-color', name: 'defaults', value: { hex: palette.vermilion, model: 'hex' } },
];
// #endregion
const [MINCHO, KYOKASHO, GOTHIC] = ['Zen Old Mincho', 'Klee One', 'Noto Sans JP'];
const [BODY, LEAD, CHARS, LINES] = [10.5, 21, 36, 16]; // pt, pt: 36字 × 16行, a 2 em pitch
const KANBUN = 15; // pt: the classical text, set larger on two lines of the grid
// #region answer: kanbun with 返り点 and 送り仮名, its yomikudashi beside it in furigana
// :kunten[習]{kaeri="レ" okuri="フ"} sets the return mark small at the character's lower
// left and the okurigana at its lower right, down the line; the text keeps its Chinese
// order, which the reader follows by the marks. cjk.kunten sizes and colours them: half
// the character, in vermilion. The Japanese reading under each passage is plain kana and
// kanji with furigana: {君子|くん|し} gives each character its reading (jukugo ruby).
const cjk = {
grid: { enabled: true, charsPerLine: CHARS, linesPerPage: LINES },
kunten: { fontSize: em(0.5), color: col('vermilion'), placement: 'inline' },
};
const paragraphStyles = [
// The text: 15 pt on a pitch of two grid lines, room for the okurigana beside it. A
// quatrain takes two lines, a couplet to the line with a space between its verses.
{ id: 'kanbun', fontFamily: MINCHO, fontSize: pt(KANBUN), lineHeight: pt(2 * LEAD),
firstLineIndent: em(0), textAlign: 'justify' },
{ id: 'shi', fontFamily: MINCHO, fontSize: pt(KANBUN), lineHeight: pt(2 * LEAD),
indent: em(2), firstLineIndent: em(0), marginTop: pt(0), marginBottom: pt(0) },
// The reading (書き下し文), two characters down in a school-book hand.
组合好的script.js可以直接运行:把它粘贴到任何页面的模块脚本中,或在CodePen上打开这道食谱。 GitHub上的食谱文件夹 ↗ (在新标签页中打开)
变化
#训点印成黑色
印刷的读本用正文的墨色印训点;去掉颜色即可。
- kunten: { fontSize: em(0.5), color: col('vermilion'), placement: 'inline' },
+ kunten: { fontSize: em(0.5), placement: 'inline' },#把训点放在行间
placement: 'interlinear'把返り点移出行,放到字下半部旁边的空隙里,这样段落保持白文的字距。JIS把它们排在行内,这是默认值。
- kunten: { fontSize: em(0.5), color: col('vermilion'), placement: 'inline' },
+ kunten: { fontSize: em(0.5), color: col('vermilion'), placement: 'interlinear' },常见问题
易错点
日文文本标记为'ja',不要用zh-Hans或LANG
食谱的版本是en和es,但日文示例在两个版本里都是日文:`locale: LANG`会把它标记为英文或西班牙文,中文标记则会按中文规则排它(开明式标点、小假名可以出现在行首、图代替図、PDF中用中文字形)。postext 1.30起,这个标记也是文字成形所用的语言(测量、绘制和嵌入都按它进行),所以'ja'以外的标记给出的不是日文字形(中文标记给出中文字形),断行的位置也不同。写'ja':它选用日本地区(JLReq断行和标点、芝麻着重号、振假名的分布、図和表标签),并关闭断词。lint会让带假名却标记为zh或ko的文本失败。 日文禁则处理 →
易错点
中文字体通过cjk块分片加载
Fontsource把一个中文、日文或韩文字体家族按每个字重约一百个文件提供,每个文件覆盖一段字符范围。loadFonts只获取latin文件,所以屏幕上的汉字来自系统字体,测量不准;fontsourceProvider交给PDF的也是这个latin文件,汉字印出来是空框。列出kit中的cjk块,在loadFonts之后调用loadCjkFonts(FONTS, markdown)(书中用到几种CJK字体时,每种字体调用一次,并传入它所排的文字),并给renderToPdf传fontProvider: cjkPdfProvider:两者都会取用包含文中字符的那些文件。 中日韩字体 →
易错点
右装订的书用showBook显示跨页
在右装订的书中(阿拉伯文、希伯来文或波斯文,竖排中文,或page.binding 'right'),第1页仍是奇数页(recto),但它位于书脊左侧,跨页读作[3 | 2]。showPages把所有书都按左装订排列;book块中的showBook(cjk块中也有同一个函数)读取doc.binding,把跨页左右镜像。capture.hero仍按阅读顺序[偶数页, 奇数页]指定跨页:[2, 3]。 右翻书 →
致谢
- 文本
- 論語 (the Analects of Confucius), 學而 1 and 3, 爲政 11, and 孟浩然「春曉」 (Spring Dawn), in shinjitai; the kunten (返り点, 送り仮名) and the yomikudashi follow the usual Japanese school reading and were set for this recipe (CC BY 4.0) · Confucius and his disciples; Meng Haoran; Ignacio Ferro (kunten and reading) · 公有领域
- 字体
- Zen Old Mincho (SIL OFL 1.1) · Klee One (SIL OFL 1.1) · Noto Sans JP (SIL OFL 1.1)


