圖書格式

Scripts and writing

Letter charts, stroke data, Japanese furigana and Chinese verse.

規範正文為英文。

L is a Localized map (base-language text by locale); ? marks an optional field.

Scripts and writing

For books that teach an alphabet or characters.

kind Fields Shows
grid layout, rows, details? A tappable chart of letters or kana (below).
letterForms cells: [{glyph, cellId?, label?: L, word?: sentence item}], highlight The shapes of one letter, each with an example word.
writingForms word, separateLabel L, joinedLabel L, letters: [{isolated, form, colorRole, label: L}] A word shown letter by letter, then joined. colorRole: isolated, initial, medial, final.
vowelMarks forms: [{glyph, sound, name: L, audio?}], words?: [{marked, plain, sound, gloss: L, audio?}] Short-vowel marks, shown large.
strokeGuide glyph, cellId? One character with its stroke order.
strokeGuideRow cells: [{glyph, cellId?, label?: L}] Several characters in a row, each with stroke order.
writingAnimation glyph, cellId?, autoplay?, loop? A character drawing itself.
articulation src, text L, title? L A mouth diagram with how to make the sound.
mathAnim name, caption? L Reserved for animations built into the app.

Grid. layout is {rows: {header: bool, title?: L}, columns: {header: bool, items: [{id, title: L}]}, cellAspect: "square" | "wide", direction?: "ltr" | "rtl"}. Each row is {id, header?: {label: L, subLabel?, audio?, tap?}, cells: [{id?, glyph, subLabel?, native?, audio?, tap?}]}. tap is {"action": "audio"}, {"action": "detail", "ref": "<key in details>"} or {"action": "link", "href": "…"}. details maps a ref to {title?: L, blocks: [...]}, a page opened from the cell.

Stroke data. Writing blocks find their strokes in strokes/<cellId>.json (or the glyph when there is no cellId), with an optional strokes/<cellId>.svg outline:

{ "cellId": "a-iso", "glyph": "a", "recordedAt": "2026-01-01T00:00:00Z",
  "strokes": [ { "points": [ { "x": 0.75, "y": 0.62, "t": 0.0 }, { "x": 0.70, "y": 0.62, "t": 0.05 } ] } ] }

x and y run from 0 to 1 across a square cell (origin top left); t is seconds from the start of that stroke. Strokes are drawn in list order.

Japanese: furigana (formatVersion 3)

Readings over kanji are written inside target text with Unicode interlinear annotation: U+FFF9 base U+FFFA reading U+FFFB. For example "日本にほんに いきます。".

In a book whose target language is ja:

  • Every kanji in fa text carries its reading, unless it is in a vocabulary entry, whose reading goes in marked instead.
  • Do not put annotation in template, wordBank, speakerTarget or passage text, which are shown as plain text. Use kana there.

Chinese verse (formatVersion 5)

A verse block preserves authored lines and stanzas. Each title and line carries both original and simplified strings. Both survive publishing into either Chinese edition. The original string is the publisher’s transcription of its identified source, including variant characters and editorial punctuation. Supply and review the simplified text separately.

{
  "kind": "verse",
  "id": "guanju",
  "title": { "original": "關雎", "simplified": "关雎" },
  "stanzas": [{
    "id": "stanza-1",
    "lines": [{
      "id": "line-1",
      "text": { "original": "關關雎鳩,在河之洲。", "simplified": "关关雎鸠,在河之洲。" }
    }]
  }]
}

title and source are optional. source is a localized map for source attribution. From feature level 10, optional sourceForms: {"original": "國風 · 周南", "simplified": "国风 · 周南"} lets the subtitle follow the title/body text toggle. Both forms survive edition packaging; when absent, the edition-localized source remains the fallback. In horizontal reading the subtitle sits immediately below the title, before the poem. Every stanza has a stable unique id and a nonempty lines array. Line IDs are unique within the poem. Both text strings are nonempty and contain no embedded line breaks. Stanza and line arrays define reading order. The excerpt above illustrates the structure for authoring.

Set meta.direction to ltr and meta.language.base to the edition’s zh-Hans or zh-Hant. Chinese reader controls, contents, search and bookmark sheets follow that base locale. The reader independently selects original or simplified text, and horizontal or vertical reading. A book of classical text sets "plainText": true in style.literature. Its readers then see the lines of a verse without punctuation by default, as classical Chinese was written, and get a control that turns the punctuation on; keep the punctuation in the source text. Without plainText (the default, and right for every other language) verse always shows its punctuation and line breaks as written, and there is no control. Pause, stop, quotation and title marks are hidden; brackets and a variant slash are kept. Without punctuation the lines of a stanza run on as one paragraph, and only the break between stanzas remains, so use a new stanza wherever a blank line must stay. Titles, sources and notes always show their punctuation. These preferences are saved per edition. Vertical verse reads top to bottom, with successive columns running right to left. Native vertical glyph forms position punctuation and brackets. Long lines wrap into additional columns. Controls remain horizontal; subtitle placement follows the selected literature preset. Search indexes both transcriptions against the same block and section IDs.

Feature level 8 adds optional notes to a verse:

"notes": {
  "title": {"zh-Hans": "注释", "zh-Hant": "註釋"},
  "text": {"zh-Hans": "河边鸟鸣引出对伴侣的思念。", "zh-Hant": "河邊鳥鳴引出對伴侶的思念。"}
}

Both maps are required and nonempty when notes is present. Notes follow the edition language, independently of the poem’s original/simplified selection. They appear after one blank line (one blank column in vertical reading), in smaller type with a bold heading. notesFontSize customizes that type size within the bounds above. Notes participate in search, proofing and paid-book sample packaging. Original poem lines and stable IDs remain unchanged.

Notes may carry subheadings. Put each subheading in text as a paragraph of its own (paragraphs are separated by one blank line) and list it in the optional subtitles array, one localized map per subheading:

"notes": {
  "title": {"zh-Hans": "导读", "zh-Hant": "導讀"},
  "text": {"zh-Hans": "此文出自杜甫的《春望》。\n\n白话解读\n\n国都沦陷,山河还在。", "zh-Hant": "…"},
  "subtitles": [{"zh-Hans": "白话解读", "zh-Hant": "白話解讀"}]
}

A paragraph that equals a listed subtitle is set in the same bold type as the notes heading. An app that does not know subtitles shows the paragraph in ordinary type, so it needs no higher feature level.

Notes may also carry verticalText, a second localized map with the same keys as text. The reader shows it in place of text when the verse is read vertically. Use it where the horizontal notes hold text that sets badly in a vertical column: a Chinese classic gives a reading as pinyin in brackets in text (雎鳩(jū jiū)), which would lie on its side in a column. In verticalText each character carries its own pinyin as an annotation, written like furigana: U+FFF9 character U+FFFA pinyin U+FFFB, one character per annotation (雎jū鳩jiū). The reader keeps the characters in line down the column and sets each pinyin upright to the left of its character, ending at the character. Search and proofing use text. An app that does not know verticalText shows text in both directions, so it needs no higher feature level.

Reader toolbar buttons change text form and reading direction with one tap. The style icon cycles through publisher presets in order, wrapping to the first; VoiceOver announces the edition-localized current value. No popup is needed for these three controls.