本文へスキップ
レシピ番号149

レシピ集 · 第11章 · コミックと漫画

右から左へ読む、縦組み写植の漫画

右から左へ読むように描いた漫画2ページ。artDirection rtlでどの版でもコマの順を保ち、日本語の吹き出しは縦の列で組みます。

このページの内容
出力
Canvas · PDF
レベル
中級
Postext
Postext 1.65.0で検証済み
1.65.0以上が必要 · postext-pdf ≥ 1.65.0
ライセンス
2026年10月31日更新
コードMIT · 本文CC BY 4.0

1〜2ページ(全4ページ)

  • 仕上がり128 × 182 mm
  • 2段, 段間7.5 mm
  • Zen Antique 9/15
  • 4ページ
  • レベル
  • Postext 1.65.0
  • 組版時間1137 ms
  • コード141行

かんたんな説明

日本の漫画2ページです。日本語版は細い列に上から下へ文字を入れ、ほかの言語の版も右上のコマから読む日本語版の順番をそのまま保ちます。

できあがり

このレシピのために書き、白黒で描いた剣道漫画『前の晩』の冒頭2ページです。県大会の前日、花はひとりで素振りを続け、空が神社のお守りを届けに来て、森先生がふたりを帰らせます。先に日本語の原版を置き、週刊誌と同じように写植します。かなは明朝、漢字はゴシックのアンチック体で、吹き出しは横に広げず縦に長く、末尾の句点は落とします。見開きの向かいには、同じ2ページを英語で組みます。文字は横組みですが、2000年代の初めからの翻訳版と同じく、右上のコマから読みます。判型はB6判(128 × 182 mm)、単行本の大きさです。

このレシピが答える質問

  • 右から左へ読む漫画を組むには?
  • 吹き出しに日本語を縦書きで写植するには?

手短な答え

script.js · 46〜62行コード全体で見る
const comics = (lang) => ({
  // The pages were drawn for right-to-left reading: panel 1 sits top right. The
  // reading direction stays 'auto', which follows the art in a left-to-right
  // language too: the English page keeps the Japanese panel order.
  artDirection: 'rtl',
  mirrorArt: false, // never flop the art: Hana's grip on the sword, the kimono's fold
  gutter: { horizontal: mm(4.5), vertical: mm(2) }, // a tier gap twice the panel gap
  panel: { borderWidth: pt(0.9), borderColor: col('ink'), background: col('paper') },
  lettering: {
    fontFamily: EDITIONS[lang].faces[0], color: col('ink'),
    fontSize: pt(['ja', 'zh'].includes(lang) ? 8.5 : 7.5), // one size per edition
    // 'auto' sets Japanese in columns of 8 characters at most and drops the final 。.
    // Chinese goes in columns too: a book bound on the right never mixes the two.
    writingMode: lang === 'zh' ? 'vertical' : 'auto',
  },
  balloonStyles: balloons(),
});

材料

種類
Zen Antique, Dela Gothic One, Comic Neue, Bangers, Noto Sans SC, ZCOOL KuaiLe, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
素材
  • kendo-charm.jpg
  • kendo-closeup.jpg
  • kendo-coach.jpg
  • kendo-dojo.jpg
  • kendo-doorway.jpg
  • kendo-kneel.jpg
  • kendo-roof.jpg
  • kendo-smile.jpg
  • kendo-swing.jpg
  • The school's old wooden kendo dojo at dusk, its doors open and lit (Generated With Diffusion Models, オリジナル)
  • Hana alone in the dojo, swinging her bamboo sword overhead (Generated With Diffusion Models, オリジナル)
  • Sora peeking round the sliding door with a shrine charm (Generated With Diffusion Models, オリジナル)
  • Close-up of Hana's sweating face (Generated With Diffusion Models, オリジナル)
  • Sora holding out the charm to Hana (Generated With Diffusion Models, オリジナル)
  • Coach Mori in the doorway, backlit, arms crossed (Generated With Diffusion Models, オリジナル)
  • Close-up of Coach Mori's small smile (Generated With Diffusion Models, オリジナル)
  • Hana tying the charm to her armour while Sora scratches his head (Generated With Diffusion Models, オリジナル)
  • Hana and Sora on the school roof at sunset, seen from behind (Generated With Diffusion Models, オリジナル)

作り方

#1 · 描かれた向きに読む

コードは前の手短な答えにあります。漫画家はどのページも右上から組み立てます。最初のコマ、最初に話す人物、段をたどる視線は、どれもそこから始まります。artDirection: 'rtl'でそれをエンジンに伝え、読む方向を'auto'のままにしておけば、どの版も絵に従います。アラビア語版はもともと右から左へ読みます。絵を反転させることはありません。欧米の出版社は2002年ごろまで漫画を左右反転して出しており、剣士はみな左利きになり、着物の合わせは逆になりました。描いたままのページは読者に慣れをひとつ求めるだけですが、反転は絵そのものを損ないます。各:::pageはコマ割り30 / 34 [46 | *] / * [44 | *]の割り方で、どの段も最初のコマが右に来ます(読む方向)。

#2 · 人物の位置は絵の上に一度だけ記す

script.js · 238〜385行コード全体で見る
const ART = { // fractions of the picture: the same in every language
  dojo: {
    alt: t({ en: 'The old wooden kendo dojo at dusk, its doors open and lit.',
      es: 'El viejo dojo de madera al anochecer, con las puertas abiertas e iluminadas.',
      ca: 'L’antic dojo de fusta al capvespre, amb les portes obertes i il·luminades.',
      fr: 'Le vieux dojo en bois au crépuscule, portes ouvertes et éclairées.',
      de: 'Das alte Kendo-Dojo aus Holz in der Abenddämmerung, die Türen offen und erleuchtet.',
      it: 'Il vecchio dojo di legno all’imbrunire, con le porte aperte e illuminate.',
      pt: 'O velho dojô de madeira ao anoitecer, com as portas abertas e iluminadas.',
      zh: '黄昏时分的老木造剑道场,门敞开着,里面亮着灯。',
      ar: 'قاعة الكندو الخشبية القديمة عند الغسق، أبوابها مفتوحة ومضاءة.',
      ja: '夕暮れの古い木造の剣道場。戸が開いて、中に明かりがともっている。' }),
  safeArea: { x: 0.45, y: 0.32, width: 0.5, height: 0.51 },
  anchors: [{ id: 'dojo', x: 0.66, y: 0.63 }] },
  swing: {
    alt: t({ en: 'Hana, alone in the dojo, swings her bamboo sword overhead.',
      es: 'Hana, sola en el dojo, alza la espada de bambú sobre la cabeza.',
      ca: 'La Hana, sola al dojo, aixeca l’espasa de bambú per sobre del cap.',
      fr: 'Hana, seule dans le dojo, lève son sabre de bambou au-dessus de sa tête.',
      de: 'Hana, allein im Dojo, schwingt ihr Bambusschwert über dem Kopf.',
      it: 'Hana, sola nel dojo, alza la spada di bambù sopra la testa.',
      pt: 'Hana, sozinha no dojô, ergue a espada de bambu acima da cabeça.',
      zh: '花独自在道场里,把竹剑高举过头。',
      ar: 'هانا وحدها في القاعة ترفع سيف الخيزران فوق رأسها.',
      ja: 'ひとり道場で、竹刀を頭上に振りかぶる花。' }),
  safeArea: { x: 0.36, y: 0, width: 0.31, height: 0.5 },
  avoid: [{ x: 0.43, y: 0, width: 0.17, height: 0.12 }],
  anchors: [{ id: 'hana', x: 0.535, y: 0.28, head: { x: 0.53, y: 0.22 },
    face: { x: 0.49, y: 0.14, width: 0.11, height: 0.17 } }] },
  doorway: {
    alt: t({ en: 'Sora peeks round the sliding door, holding a shrine charm.',
      es: 'Sora se asoma por la puerta corredera con un amuleto en la mano.',
      ca: 'En Sora treu el cap per la porta corredissa amb un amulet a la mà.',
      fr: 'Sora passe la tête par la porte coulissante, une amulette à la main.',
      de: 'Sora späht mit einem Schreinamulett in der Hand um die Schiebetür.',
      it: 'Sora si affaccia dalla porta scorrevole, con un amuleto in mano.',
      pt: 'Sora espia pela porta de correr com um amuleto na mão.',
      zh: '空从拉门后探出头,手里攥着护身符。',
      ar: 'سورا يطلّ من وراء الباب المنزلق وفي يده تميمة.',
      ja: 'お守りを手に、引き戸の陰からのぞく空。' }),
  safeArea: { x: 0.37, y: 0.09, width: 0.34, height: 0.5 },
  avoid: [{ x: 0.49, y: 0.41, width: 0.08, height: 0.1 }],
  anchors: [{ id: 'sora', x: 0.545, y: 0.31, head: { x: 0.55, y: 0.22 },
    face: { x: 0.47, y: 0.16, width: 0.2, height: 0.18 } }] },
  closeup: {
    alt: t({ en: "Close-up of Hana's sweating, startled face.",
      es: 'Primer plano del rostro sudoroso y sobresaltado de Hana.',
      ca: 'Primer pla de la cara suada i sobresaltada de la Hana.',
      fr: 'Gros plan sur le visage en sueur et surpris de Hana.',
      de: 'Nahaufnahme von Hanas verschwitztem, erschrockenem Gesicht.',
      it: 'Primo piano del volto sudato e sorpreso di Hana.',
      pt: 'Primeiro plano do rosto suado e assustado de Hana.',
      zh: '花满脸是汗、吃了一惊的特写。',
      ar: 'لقطة قريبة لوجه هانا المتعرّق المذعور.',
      ja: '汗をかき、はっとした花の顔のアップ。' }),
  safeArea: { x: 0.27, y: 0.28, width: 0.43, height: 0.51 },
  anchors: [{ id: 'hana', x: 0.475, y: 0.665, head: { x: 0.45, y: 0.35 },
    face: { x: 0.3, y: 0.3, width: 0.4, height: 0.45 } }] },
  charm: {
    alt: t({ en: 'Sora holds out the charm; Hana looks at it, sword on her shoulder.',
      es: 'Sora le tiende el amuleto; Hana lo mira con la espada al hombro.',
      ca: 'En Sora li allarga l’amulet; la Hana el mira amb l’espasa a l’espatlla.',
      fr: 'Sora tend l’amulette ; Hana la regarde, le sabre sur l’épaule.',
      de: 'Sora hält ihr das Amulett hin; Hana betrachtet es, das Schwert auf der Schulter.',
      it: 'Sora porge l’amuleto; Hana lo guarda, con la spada sulla spalla.',
      pt: 'Sora estende o amuleto; Hana olha para ele com a espada no ombro.',
      zh: '空递出护身符,花扛着竹剑看着它。',
      ar: 'سورا يمدّ التميمة، وهانا تنظر إليها والسيف على كتفها.',
      ja: '空がお守りを差し出し、竹刀を肩にかついだ花がそれを見る。' }),
  safeArea: { x: 0.21, y: 0.09, width: 0.56, height: 0.53 },
  avoid: [{ x: 0.43, y: 0.47, width: 0.06, height: 0.09 }],
  anchors: [{ id: 'sora', x: 0.325, y: 0.335, head: { x: 0.29, y: 0.22 },
    face: { x: 0.26, y: 0.17, width: 0.11, height: 0.2 } },
  { id: 'hana', x: 0.675, y: 0.335, head: { x: 0.665, y: 0.22 },
    face: { x: 0.62, y: 0.17, width: 0.11, height: 0.2 } }] },
  coach: {
    alt: t({ en: 'Coach Mori in the doorway, backlit, arms crossed.',
      es: 'El entrenador Mori en la puerta, a contraluz, de brazos cruzados.',
      ca: 'L’entrenador Mori a la porta, a contrallum, de braços plegats.',
      fr: 'L’entraîneur Mori sur le seuil, à contre-jour, bras croisés.',
      de: 'Trainer Mori in der Tür, im Gegenlicht, mit verschränkten Armen.',
      it: 'L’allenatore Mori sulla porta, in controluce, a braccia conserte.',
      pt: 'O treinador Mori na porta, contra a luz, de braços cruzados.',
      zh: '森老师站在门口,背着光,双臂抱在胸前。',
      ar: 'المدرّب موري عند الباب، والضوء خلفه، عاقدًا ذراعيه.',
      ja: '逆光の戸口で腕を組んで立つ森先生。' }),
  safeArea: { x: 0.33, y: 0.13, width: 0.3, height: 0.32 },
  anchors: [{ id: 'mori', x: 0.425, y: 0.215, head: { x: 0.42, y: 0.17 },
    face: { x: 0.37, y: 0.13, width: 0.1, height: 0.11 } }] },
  smile: {
    alt: t({ en: "Close-up of Mori's stern face breaking into a small smile.",
      es: 'Primer plano del rostro severo de Mori, que esboza una sonrisa.',
      ca: 'Primer pla de la cara severa d’en Mori, que esbossa un somriure.',
      fr: 'Gros plan sur le visage sévère de Mori, qui esquisse un sourire.',
      de: 'Nahaufnahme von Moris strengem Gesicht, das sich zu einem kleinen Lächeln löst.',
      it: 'Primo piano del volto severo di Mori, che accenna un sorriso.',
      pt: 'Primeiro plano do rosto severo de Mori, que esboça um sorriso.',
      zh: '森老师严肃的脸上露出一丝笑意的特写。',
      ar: 'لقطة قريبة لوجه موري الصارم وقد ارتسمت عليه ابتسامة.',
      ja: '厳しい顔がふっとゆるむ森先生のアップ。' }),
  safeArea: { x: 0.43, y: 0.21, width: 0.51, height: 0.53 },
  anchors: [{ id: 'mori', x: 0.69, y: 0.52, head: { x: 0.6, y: 0.25 },
    face: { x: 0.45, y: 0.28, width: 0.45, height: 0.32 } }] },
  kneel: {
    alt: t({ en: 'Kneeling, Hana ties the charm to her armour; Sora scratches his head.',
      es: 'De rodillas, Hana se ata el amuleto a la armadura; Sora se rasca la cabeza.',
      ca: 'De genolls, la Hana es lliga l’amulet a l’armadura; en Sora es grata el cap.',
      fr: 'À genoux, Hana attache l’amulette à son armure ; Sora se gratte la tête.',
      de: 'Kniend bindet Hana das Amulett an ihre Rüstung; Sora kratzt sich am Kopf.',
      it: 'In ginocchio, Hana lega l’amuleto all’armatura; Sora si gratta la testa.',
      pt: 'De joelhos, Hana amarra o amuleto na armadura; Sora coça a cabeça.',
      zh: '花跪坐着把护身符系在护具上,空挠着头。',
      ar: 'هانا جاثية تربط التميمة بدرعها، وسورا يحكّ رأسه.',
      ja: '正座してお守りを防具に結ぶ花と、頭をかく空。' }),
  safeArea: { x: 0.21, y: 0.08, width: 0.61, height: 0.48 },
  avoid: [{ x: 0.27, y: 0.43, width: 0.06, height: 0.12 }],
  anchors: [{ id: 'hana', x: 0.305, y: 0.245, head: { x: 0.3, y: 0.17 },
    face: { x: 0.25, y: 0.1, width: 0.11, height: 0.17 } },
  { id: 'sora', x: 0.7, y: 0.25, head: { x: 0.71, y: 0.15 },
    face: { x: 0.64, y: 0.1, width: 0.13, height: 0.18 } }] },
  roof: {
    alt: t({ en: 'Seen from behind, Hana and Sora sit on the school roof at sunset.',
      es: 'De espaldas, Hana y Sora sentados en la azotea del instituto al atardecer.',
      ca: 'D’esquena, la Hana i en Sora asseguts al terrat de l’institut a la posta.',
      fr: 'De dos, Hana et Sora assis sur le toit du lycée au coucher du soleil.',
      de: 'Von hinten: Hana und Sora sitzen bei Sonnenuntergang auf dem Schuldach.',
      it: 'Di spalle, Hana e Sora seduti sul tetto della scuola al tramonto.',
      pt: 'De costas, Hana e Sora sentados no terraço da escola ao pôr do sol.',
      zh: '夕阳下,花和空坐在学校楼顶的背影。',
      ar: 'هانا وسورا جالسان على سطح المدرسة عند الغروب، من الخلف.',
      ja: '夕焼けの屋上に並んで座る花と空の後ろ姿。' }),
  safeArea: { x: 0.24, y: 0.41, width: 0.47, height: 0.31 },
  anchors: [{ id: 'hana', x: 0.36, y: 0.52, head: { x: 0.36, y: 0.48 },
    face: { x: 0.31, y: 0.43, width: 0.11, height: 0.14 } },
  { id: 'sora', x: 0.63, y: 0.52, head: { x: 0.625, y: 0.47 },
    face: { x: 0.58, y: 0.41, width: 0.1, height: 0.15 } }] },
};
const panels = () => Promise.all([
  comicPanel('dojo', asset('kendo-dojo.jpg'), ART.dojo),
  comicPanel('swing', asset('kendo-swing.jpg'), ART.swing),
  comicPanel('doorway', asset('kendo-doorway.jpg'), ART.doorway),
  comicPanel('closeup', asset('kendo-closeup.jpg'), ART.closeup),
  comicPanel('charm', asset('kendo-charm.jpg'), ART.charm),
  comicPanel('coach', asset('kendo-coach.jpg'), ART.coach),
  comicPanel('smile', asset('kendo-smile.jpg'), ART.smile),
  comicPanel('kneel', asset('kendo-kneel.jpg'), ART.kneel),
  comicPanel('roof', asset('kendo-roof.jpg'), ART.roof),
]);

言葉は言語ごとに変わりますが、絵は変わりません。どの絵にも、どう切り抜いても残すセーフエリアがあり、人物ごとに口(しっぽの向かう先)、頭(思考の吹き出し用)、吹き出しで隠してはいけない顔を、絵に対する割合で記します。台本の各行は話者を指定し(sora: …)、エンジンはどの言語でもその人物の近くに吹き出しを置きます。森先生が戸口に現れるコマの空のように、絵に写っていない話者にはコマの縁へ向かうしっぽを付けます(sora{tail=bottom})。

#3 · 吹き出しの中身は言語ごとに

script.js · 66〜73行コード全体で見る
const balloons = () => [
  { id: 'speech', fill: col('paper'), stroke: col('ink'), strokeWidth: pt(0.6), roundness: 2 },
  { id: 'whisper', fill: col('paper'), stroke: col('ink'), roundness: 2 },
  { id: 'thought', fill: col('paper'), stroke: col('ink') },
  { id: 'inner', fill: col('tone'), stroke: col('tone'), strokeWidth: pt(0), italic: false },
  { id: 'caption', fill: col('paper'), stroke: col('ink'), strokeWidth: pt(0.5) },
  { id: 'sfx', color: col('ink'), haloColor: col('paper') },
];

スタイルが決めるのは声の種類です。ふつうの台詞は楕円、ささやきは破線、心の声は雲形、花の内心は灰色の囲みです。中の文字の並べ方は版ごとに決まります。日本語では、エンジンが1列8字までの縦の列で組み、吹き出し末の「。」を落として「、」は残し、第42回の2桁を縦中横で1字分に収め(:tcy[42])、!?を1字の中に横に並べます。台本では名前が初めて出るところに読みを付けます({一ノ瀬|いちのせ})。漫画が人名にルビを振るのと同じです。英語では同じ吹き出しが横組みの楕円になり、読む順は右から始まったままです。

#4 · 各版の書体はその版の言葉で読み込む

script.js · 389〜401行コード全体で見る
const SFX = /^sfx[^::\n]*[::](.*)$/gm; // sound-effect lines: the second face sets them
async function loadEdition(lang) {
  const text = TEXT[lang];
  const [face, sfx] = EDITIONS[lang].faces;
  const faces = { [face]: FONTS[face], [sfx]: FONTS[sfx] };
  if (['ja', 'zh'].includes(lang)) { // CJK: only the files that hold these characters
    const effects = [...text.matchAll(SFX)].map((m) => m[1]).join('');
    await loadCjkFonts({ [face]: FONTS[face] }, text.replace(SFX, ''), { vertical: true });
    await loadCjkFonts({ [sfx]: FONTS[sfx] }, effects, { vertical: true });
  }
  if (lang === 'ar') await loadArabicFonts(faces, text);
  await loadComicFonts(faces, text); // the bold and italic the faces do not ship
}

Zen AntiqueとDela Gothic Oneは、文字の範囲ごとにそれぞれ100ほどのファイルに分かれています。書体ごとに組む言葉を渡して読み込むので(前者は吹き出し、後者は描き文字)、ページは必要なファイルだけを取りに行きます。loadComicFontsは、叫びの太字や内心のイタリックを、これらの書体が実際に持っているファイルから宣言します。画面とPDFで同じ字形になります。

#5 · 各版の向かいに原版を置く

script.js · 406〜416行コード全体で見る
const FACING = LANG === 'ja' ? 'en' : LANG; // Japanese readers see the English edition
const TEXT = { ja: original, [FACING]: LANG === 'ja' ? english : markdown };
await loadFonts(FONTS, Object.values(TEXT).join('\n'));
const resources = await panels();
const build = async (lang) => { // the same pictures and page; this language's lettering
  await loadEdition(lang);
  return withLoadedFonts(() => buildDocument({ markdown: TEXT[lang], resources,
    continuation: { pageIndexOffset: 1 } }, edition(lang)),
    { ...kitFonts(FONTS), text: TEXT[lang] });
};
const docs = [await build('ja'), await build(FACING)];

このサイトの言語ごとに2ページの版があり、それぞれのcontent.<lang>.mdに書きます。どの版も日本語の原版と向かい合わせです。/* @content@ja */がすべての版にcontent.ja.mdを取り込み、日本語のページでは原版の向かいに英語版を置きます。右開きの本では縦と横の吹き出しを混ぜないので、中国語版も縦の列で組みます。アラビア語版は、その言語の向きのまま右から左へ読みます。

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 149 · Manga read right to left, lettered vertically ══════
// https://postext.dev/en/cookbook/manga-right-to-left
// Code: MIT · Story: written for the recipe (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Zen Antique, Comic Neue and six more (SIL OFL 1.1) · Needs postext ≥ 1.65.0
// Two pages of a kendo manga: the Japanese original, then the same pages lettered again.
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerResourceImage, loadVerticalAlternates,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'ja'; // @lang: this edition's language; the Japanese original faces it
const RECIPE = 'manga-right-to-left';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: black ink on a warm white, one screen-tone grey
const palette = {
  ink: '#151413', // panel borders, balloon outlines, the lettering
  paper: '#fdfcf9', // the page and the balloons
  tone: '#e8e6e1', // the inner-voice box, a light screen tone
  muted: '#6f6b64',
  accent: '#a8322b', // the cover red (the Folio case in recipe.json)
};
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: 'ink (defaults)', value: { hex: palette.ink, model: 'hex' } },
];
// #endregion

// The engine's lettering and sound-effect faces per language (defaultComicFont and
// defaultComicSfxFont), written out so FONTS and the PDF know them.
const EDITIONS = {
  ja: { locale: 'ja', faces: ['Zen Antique', 'Dela Gothic One'] },
  en: { locale: 'en-us', faces: ['Comic Neue', 'Bangers'] },
  es: { locale: 'es', faces: ['Comic Neue', 'Bangers'] },
  ca: { locale: 'ca', faces: ['Comic Neue', 'Bangers'] },
  pt: { locale: 'pt-BR', faces: ['Comic Neue', 'Bangers'] },
  fr: { locale: 'fr', faces: ['Comic Neue', 'Bangers'] },
  de: { locale: 'de', faces: ['Comic Neue', 'Bangers'] },
  it: { locale: 'it', faces: ['Comic Neue', 'Bangers'] },
  zh: { locale: 'zh-Hans', faces: ['Noto Sans SC', 'ZCOOL KuaiLe'] },
  ar: { locale: 'ar', faces: ['Playpen Sans Arabic', 'Lalezar'] },
};

// #region answer: the art reads right to left, so every edition does
const comics = (lang) => ({
  // The pages were drawn for right-to-left reading: panel 1 sits top right. The
  // reading direction stays 'auto', which follows the art in a left-to-right

組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)

よくあるつまずき

つまずき

日本語のテキストのタグは'ja'。zh-HansやLANGにしない

レシピの版はenとesですが、日本語のサンプルはどちらの版でも日本語です。`locale: LANG`では英語やスペイン語とタグ付けされ、中国語のタグでは中国語の規則で組まれます(開明式の約物、小書きの仮名が行頭に来てもよい、図の代わりに图、PDFでは中国の字形)。postext 1.30以降、このタグはテキストを組む言語(計測、描画、埋め込みに使う言語)でもあるので、'ja'以外のタグでは日本語の字形ではなく別の字形(中国語のタグでは中国の字形)になり、改行の位置も変わります。'ja'と書いてください。日本の地域(JLReqの改行と約物、ゴマの圏点、ルビの間隔、図と表の表示名)が選ばれ、ハイフネーションが切られます。リントは、zhやkoのタグで仮名を含むテキストをエラーにします。 日本語の改行(禁則処理) →

つまずき

中国語の書体はcjkブロックを通じてスライス単位で読み込む

Fontsourceは中国語、日本語、韓国語のファミリーを、ウェイトごとに約100個のファイルとして配信し、各ファイルが文字の範囲を受け持ちます。loadFontsが取得するのはlatinファイルだけなので、画面では漢字がシステムの書体で出て計測が狂い、fontsourceProviderはPDFにそのlatinファイルを渡すため、漢字が空の四角で印字されます。キットのcjkブロックを挙げ、loadFontsのあとにloadCjkFonts(FONTS, markdown)を呼び(本で複数のCJK書体を使うときは、それぞれの書体で組むテキストを渡して書体ごとに1回)、renderToPdfにfontProvider: cjkPdfProviderを渡してください。どちらもテキストの文字を含むファイルを取得します。 中国語・日本語・韓国語のフォント →

  • 各コマで最初に話す人物は右に置きます。吹き出しは読む順に並ぶので、空がお守りを渡すコマでは、台本で右に立つ花に最初の台詞を言わせています。空が先に話しても、その吹き出しは空の側に収まりますが、縦組みの行の下には花の返事を置く余白がなく、返事は右に並んで先に読まれてしまいます。
  • コマに入りきらない吹き出しは枠の外へはみ出すことがあり、エンジンはそれを警告します(comicBalloonOverflow)。台詞を削る前に、コマ割りでそのコマを広げてください。
  • 縦長のコマに小さく立つ人物の横には、重ねた吹き出し二つぶんの余地がありません。戸口のコマでは、横組みの各版で先生の二つめのせりふが胸からひざまでかぶっていました。これらの版の台本では、一つめのせりふを頭の横に固定しています(mori{at="85% 19%"})。つながった二つめもそれについていきます。中国語のページでは、吹き出しを一つ、行末のバックスラッシュで手で改行しています。縦の列が「其实」を二つに割っていたからです。

クレジット

レシピ
Ignacio Ferro
本文
  • 前の晩 (The Night Before), a two-page kendo manga written for this recipe, with its English, Spanish, Catalan, Chinese and Arabic letterings · Postext Cookbook · CC BY 4.0
画像
  • The school's old wooden kendo dojo at dusk, its doors open and lit · Generated With Diffusion Models · オリジナル
  • Hana alone in the dojo, swinging her bamboo sword overhead · Generated With Diffusion Models · オリジナル
  • Sora peeking round the sliding door with a shrine charm · Generated With Diffusion Models · オリジナル
  • Close-up of Hana's sweating face · Generated With Diffusion Models · オリジナル
  • Sora holding out the charm to Hana · Generated With Diffusion Models · オリジナル
  • Coach Mori in the doorway, backlit, arms crossed · Generated With Diffusion Models · オリジナル
  • Close-up of Coach Mori's small smile · Generated With Diffusion Models · オリジナル
  • Hana tying the charm to her armour while Sora scratches his head · Generated With Diffusion Models · オリジナル
  • Hana and Sora on the school roof at sunset, seen from behind · Generated With Diffusion Models · オリジナル
フォント
Zen Antique (SIL OFL 1.1) · Dela Gothic One (SIL OFL 1.1) · Comic Neue (SIL OFL 1.1) · Bangers (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · ZCOOL KuaiLe (SIL OFL 1.1) · Playpen Sans Arabic (SIL OFL 1.1) · Lalezar (SIL OFL 1.1)
SandboxPDF