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

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

見開きにわたる漫画の一ページ

spreadを付けた :::pageで、一つのコマ割りを向かい合う二ページに広げます。パノラマはのどをまたぎ、下の段はのどで分かれます。

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

2〜3ページ · 1〜2/2

  • 仕上がり230 × 300 mm
  • 1段
  • Zen Antique 11/15
  • 2ページ
  • レベル
  • Postext 1.65.0
  • 組版時間301 ms
  • コード141行

かんたんな説明

向かい合う二ページを一枚のページのように使った漫画。人でいっぱいの市場の横長の絵が本の真ん中をまたぎ、その下に三つのコマが並びます。

できあがり

No. 152のアルバムの二つ目のお話『おじいちゃん!』を、向かい合う二ページで語ります。十二月の土曜日、市場は人でいっぱいで、ローラは人ごみでおじいちゃんとはぐれてしまいます。見開きの上半分は幅432mmのパノラマ一枚。左端に小さなローラ、右端に彼女を探すパコ、そのあいだを市場の通路が走ってのどへ続きます。その下に三コマ。大人の脚のあいだで一人きりのローラ、果物の箱に乗って指笛を吹くパコ、ベレー帽が宙に舞う再会です。コマ割りは二ページ分を一度だけ書くので、パノラマはのどをまたぎ、下の段の間白はちょうどのどに落ちます。原作はスペイン語で、英語、カタルーニャ語、中国語、アラビア語、日本語、ポルトガル語、フランス語、ドイツ語、イタリア語の版が同じ見開きに写植します。

このレシピが答える質問

  • 漫画のページを見開きいっぱいに広げるには?

手短な答え

script.js · 40〜53行コード全体で見る
// The content writes :::page{spread split="55 / * [25 | 25 | *]"}: one frame from the verso's
// outer margin to the recto's (the inner margins drop out), split as one page. The panorama
// crosses the spine; the line at 50 % of the lower tier is the spine itself, so its gutter
// straddles the fold and no panel is cut by it.
const comics = {
  gutter: { horizontal: mm(5), vertical: mm(4) }, // 2 mm of white on each side of the fold
  panel: { borderWidth: pt(0.75), borderColor: col('ink'), background: col('paper') },
  lettering: { fontFamily: LETTER, fontSize: pt(LATIN ? 9.5 : 8.5), lineHeight: 1.1,
    color: col('ink') },
  runningHeads: true, // folios on both halves
};
// A spread opens on a verso, an even page. Page 1 of a document is a recto, so the engine
// would leave it blank and start on page 2; this episode continues an album at page 2.
const continuation = { pageIndexOffset: 1, pageNumbering: { startAt: 2 } };

材料

種類
Patrick Hand, Bangers, Noto Sans SC, ZCOOL KuaiLe, Zen Antique, Dela Gothic One, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
素材
  • ds1-1900.jpg
  • ds2.jpg
  • ds3.jpg
  • ds4.jpg
  • Panorama of the crowded market hall: tiny Lola stands lost on the far left; far right, her grandfather searches the crowd. (Generated With Diffusion Models, オリジナル)
  • Lola, tearful, stands among grown-ups' legs and shopping bags. (Generated With Diffusion Models, オリジナル)
  • Paco stands on a fruit crate and whistles through his fingers; shoppers turn to look. (Generated With Diffusion Models, オリジナル)
  • Lola leaps into her grandfather's arms; his beret flies off and the stallholders smile. (Generated With Diffusion Models, オリジナル)

作り方

#1 · 二ページで一つのコマ割り

コードは上の手短な答えにあります。漫画全体がspreadを付けた一つのディレクティブです。

:::page{spread split="55 / * [25 | 25 | *]"}
::panel{art=ds1}
caption: 十二月の土曜日、市場は人でいっぱいだった。
lola: おじいちゃん?
paco{shout}: ローラ? ローラーッ!

枠は偶数ページの小口側の余白から奇数ページの小口側の余白まで続き、のど側の余白はなくなります。一段目は高さの55%で、のどをまたぐ一コマです。二段目では25 | 25 | *が一本目の線を25%、二本目を50%、つまりのどそのものに置きます。正方形の二コマが偶数ページに、再会のコマが奇数ページに入ります。見開きは偶数ページから始まり、文書の1ページ目は奇数ページなので、ビルドにcontinuation: { pageIndexOffset: 1 }を渡します。このお話はアルバムの2ページ目から続くことになり、前に白ページは入りません。

#2 · 二ページを埋める大きさのパノラマ

script.js · 148〜238行コード全体で見る
// The panorama is 1,900 px wide: across the 432 mm of the spread it prints at about 112 dpi.
const box = ([x, y, width, height]) => ({ x, y, width, height });
const who = (id, x, y, head, face) => ({ id, x, y,
  ...(head && { head: { x: head[0], y: head[1] } }), ...(face && { face: box(face) }) });
const ART = {
  ds1: { width: 1900, height: 633, safeArea: box([.03, .27, .93, .53]),
    alt: t({ en: 'Panorama of the crowded market hall: tiny Lola stands lost on the far left; '
        + 'far right, her grandfather searches the crowd.',
      es: 'Panorámica del mercado lleno de gente: a la izquierda del todo, Lola, '
        + 'diminuta, está perdida; a la derecha del todo, su abuelo la busca entre la multitud.',
      ca: 'Panoràmica del mercat ple de gent: a l’extrem esquerre, la Lola, petitíssima, '
        + 'està perduda; a l’extrem dret, el seu avi la busca entre la gentada.',
      zh: '拥挤的市场全景:最左边,小小的萝拉迷了路;最右边,她的爷爷在人群中寻找她。',
      ar: 'منظر واسع للسوق المزدحم: لولا الصغيرة تائهة في أقصى اليسار، وفي أقصى اليمين '
        + 'جدّها يبحث عنها بين الناس.',
      ja: '人でいっぱいの市場のパノラマ。左端に小さなローラが迷子になって立ち、右端では祖父が人ごみの中を探している。',
      pt: 'Panorama do mercado lotado: na ponta esquerda, a pequena Lola está perdida; na ponta '
        + 'direita, o avô a procura no meio da multidão.',
      fr: 'Panorama de la halle du marché bondée : tout à gauche, la petite Lola est perdue ; '
        + 'tout à droite, son grand-père la cherche dans la foule.',
      de: 'Panorama der vollen Markthalle: Ganz links steht die kleine Lola verloren da; ganz '
        + 'rechts sucht ihr Großvater die Menge ab.',
      it: 'Panoramica del mercato coperto pieno di gente: all’estrema sinistra la piccola Lola si '
        + 'è persa; all’estrema destra suo nonno la cerca tra la folla.' }),
    anchors: [
      who('lola', .065, .58, [.063, .55], [.045, .51, .04, .11]),
      who('paco', .925, .38, [.925, .34], [.9, .3, .05, .12]),
    ],
    faces: [box([.062, .305, .022, .055])], // the fishmonger behind Lola, who says nothing
  },
  ds2: { width: 1152, height: 1152, safeArea: box([.31, .08, .35, .62]),
    alt: t({ en: "Lola, tearful, stands among grown-ups' legs and shopping bags.",
      es: 'Lola, con lágrimas en los ojos, está de pie entre piernas de mayores y bolsas '
        + 'de la compra.',
      ca: 'La Lola, amb llàgrimes als ulls, és dreta entre cames de grans i bosses de la compra.',
      zh: '萝拉含着眼泪,站在大人们的腿和购物袋之间。',
      ar: 'لولا والدموع في عينيها واقفة بين سيقان الكبار وأكياس التسوّق.',
      ja: '涙ぐんだローラが、大人の足と買い物袋のあいだに立っている。',
      pt: 'Lola, com lágrimas nos olhos, está de pé entre pernas de adultos e sacolas '
        + 'de compras.',
      fr: 'Lola, les larmes aux yeux, se tient entre des jambes d’adultes et des sacs de '
        + 'courses.',
      de: 'Lola steht mit Tränen in den Augen zwischen Erwachsenenbeinen und Einkaufstaschen.',
      it: 'Lola, con le lacrime agli occhi, è in piedi tra gambe di adulti e borse della '
        + 'spesa.' }),
    anchors: [
      who('lola', .505, .24, [.48, .17], [.4, .1, .18, .19]),
    ],
  },
  ds3: { width: 1000, height: 1000, safeArea: box([.34, .07, .47, .23]),
    alt: t({ en: 'Paco stands on a fruit crate and whistles through his fingers; shoppers '
        + 'turn to look.',
      es: 'Paco, subido a una caja de fruta, silba con los dedos; la gente se vuelve a mirar.',
      ca: 'En Paco, enfilat a una caixa de fruita, xiula amb els dits; la gent es gira a mirar.',
      zh: '帕科站在水果箱上,用手指吹口哨;买东西的人都回过头来看。',
      ar: 'باكو واقف على صندوق فاكهة ويصفّر بأصابعه، والمتسوّقون يلتفتون لينظروا.',
      ja: 'パコが果物の木箱に乗って指笛を吹き、買い物客がふり返る。',
      pt: 'Paco, em cima de um caixote de frutas, assobia com os dedos; as pessoas se viram '
        + 'para olhar.',
      fr: 'Paco, debout sur une cagette de fruits, siffle avec ses doigts ; les clients se '
        + 'retournent.',
      de: 'Paco steht auf einer Obstkiste und pfeift auf den Fingern; die Leute drehen sich um.',
      it: 'Paco, in piedi su una cassetta della frutta, fischia con le dita; la gente si volta a '
        + 'guardare.' }),
    anchors: [
      who('paco', .5, .2, [.47, .14], [.38, .08, .17, .16]),
      who('sfx', .62, .17),
    ],
  },
  ds4: { width: 1200, height: 800, safeArea: box([.33, .05, .48, .57]),
    alt: t({ en: "Lola leaps into her grandfather's arms; his beret flies off and the "
        + "stallholders smile.",
      es: 'Lola salta a los brazos de su abuelo; la boina sale volando y los tenderos sonríen.',
      ca: 'La Lola salta als braços del seu avi; la boina surt volant i els paradistes somriuen.',
      zh: '萝拉扑进爷爷怀里;他的贝雷帽飞了出去,摊主们都笑了。',
      ar: 'لولا تقفز إلى ذراعي جدّها، وقبعته تطير، والباعة يبتسمون.',
      ja: 'ローラが祖父の腕に飛びこむ。ベレー帽が飛び、店の人たちがほほえむ。',
      pt: 'Lola pula nos braços do avô; a boina sai voando e os feirantes sorriem.',
      fr: 'Lola saute dans les bras de son grand-père ; son béret s’envole et les marchands '
        + 'sourient.',
      de: 'Lola springt ihrem Großvater in die Arme; seine Baskenmütze fliegt davon, und die '
        + 'Händler lächeln.',
      it: 'Lola salta in braccio al nonno; il basco gli vola via e i bancarellai sorridono.' }),
    anchors: [
      who('lola', .51, .27, [.47, .2], [.42, .14, .13, .19]),
      who('paco', .595, .31, [.62, .22], [.55, .14, .15, .22]),
    ],
    avoid: [box([.67, .06, .13, .22])],
  },

};

のどをまたいで印刷されるのはパノラマだけで、432 × 144mmあるので1,900px(380KB)で用意しています。ほかの三枚は1,000〜1,200pxです。セーフエリアは横幅のほぼ全体にわたる帯で、話す二人は横幅の6%と92%の両端に立っています。のどの近くの吹き出しは製本に飲みこまれてしまうからです。絵の中央は顔のない通路で、そのままのどへ続きます。人ごみには、せりふのない顔がいくつもあります。ローラの後ろの魚屋は、何も話さない人物の顔の一覧facesに入れてあるので、最初の吹き出しは顔や帽子の上にはけっして乗らず、横に立ちます。日本語版は縦の吹き出しをそこに固定しています(at="2.8% 37%")。

#3 · アルバムの吹き出し

script.js · 57〜72行コード全体で見る
comics.balloonStyles = [
  { id: 'speech', fill: col('balloon'), stroke: col('ink'), strokeWidth: pt(0.6) },
  { id: 'caption', fill: col('cartouche'), stroke: col('ink'), strokeWidth: pt(0.6),
    padding: em(0.45), aspect: 3.4 },
  { id: 'shout', fill: col('balloon'), stroke: col('ink'), burstPoints: 16, fontScale: 1.2 },
  { id: 'whisper', fill: col('balloon'), stroke: col('ink') },
  { id: 'sfx', fontFamily: DISPLAY, color: col('orange'), halo: pt(1.6), haloColor: col('ink'),
    fontScale: 3.2 },
];
comics.cast = [
  { id: 'lola', name: 'Lola' },
  { id: 'paco', name: t({ es: 'el abuelo Paco', en: 'Grandpa Paco', ca: "l'avi Paco",
    zh: '帕科爷爷', ar: 'الجد باكو', ja: 'パコおじいちゃん', pt: 'o vovô Paco', fr: 'papi Paco',
    de: 'Opa Paco',
    it: 'nonno Paco' }) },
];

吹き出しのスタイルはNo. 152と同じです。白い吹き出し、淡い黄色のナレーション枠、パコの叫びには爆発形、ローラのささやきには破線、指笛はアルバムの擬音の書体(ラテン文字の版ではBangers)。castは、PDFとEPUBがせりふの前に読み上げる名前を渡します。

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 154 · One comic page across a double spread ═══════════════
// https://postext.dev/en/cookbook/comic-double-spread
// Code: MIT · Story: written for the recipe (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Patrick Hand, Bangers, the comic faces of each script (OFL) · Needs postext ≥ 1.34.0
// One split tree laid across two facing pages: a panorama runs over the spine, and the
// tier under it splits at the spine's gutter. Same album, same lettering as Nº 152.
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerResourceImage, defaultComicFont,
  defaultComicSfxFont,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'ja'; // @lang: 'es' | 'en' | 'ca' | 'zh' | 'ar' | 'ja' | 'pt' | 'fr' | 'de' | 'it'
const RECIPE = 'comic-double-spread';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: the album's flat colours
const palette = {
  ink: '#1d1b19', // outlines, lettering, folios
  orange: '#d9601a', // the sound effect
  cartouche: '#fbe8a6', // narration boxes
  balloon: '#ffffff',
  muted: '#5f5a54', // the colophon
  paper: '#fffdf8',
};
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: 'orange (defaults)', value: { hex: palette.orange, model: 'hex' } },
];
// #endregion

const LOCALE = t({ es: 'es', en: 'en-gb', ca: 'ca', zh: 'zh-Hans', ar: 'ar', ja: 'ja',
  pt: 'pt-BR', fr: 'fr', de: 'de', it: 'it' });
const LATIN = ['es', 'en', 'ca', 'pt', 'fr', 'de', 'it'].includes(LANG);
const LETTER = LATIN ? 'Patrick Hand' : defaultComicFont(LOCALE); // mixed-case hand lettering
const DISPLAY = defaultComicSfxFont(LOCALE); // Bangers, Dela Gothic One, ZCOOL KuaiLe, Lalezar

// #region answer: one split across two facing pages, opened on a verso
// The content writes :::page{spread split="55 / * [25 | 25 | *]"}: one frame from the verso's
// outer margin to the recto's (the inner margins drop out), split as one page. The panorama
// crosses the spine; the line at 50 % of the lower tier is the spine itself, so its gutter
// straddles the fold and no panel is cut by it.
const comics = {
  gutter: { horizontal: mm(5), vertical: mm(4) }, // 2 mm of white on each side of the fold
  panel: { borderWidth: pt(0.75), borderColor: col('ink'), background: col('paper') },
  lettering: { fontFamily: LETTER, fontSize: pt(LATIN ? 9.5 : 8.5), lineHeight: 1.1,
    color: col('ink') },

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

アレンジ

#本を見開きから始める

continuationを外すと、エンジンは1ページ目を白ページ(役割blank)にし、見開きはやはり2・3ページに入ります。

-const continuation = { pageIndexOffset: 1, pageNumbering: { startAt: 2 } };
+const continuation = {};

よくあるつまずき

  • 吹き出しはのどの両側8mmの帯には入りません。atで固定したものも同じです。のどの上に立つ話者の吹き出しは片側へ押し出されます。のどをまたぐコマでは、話者を真ん中から離してください。
  • 顔が触れ合う二人(抱き合う、組み合う)の上には、話している本人の分も含めて吹き出しを置きません。日本語版とアラビア語版では見開きを右から読み、再会のコマは左ページに移り、右上の角は舞い上がるベレー帽がふさぎます。パコの二つの吹き出しは抱き合う二人の上ではなく、頭の横の市場の上に置かれます。エンジンが顔の触れ合いを見分けられるよう、絵には二人の顔(face)を指定してください。

クレジット

レシピ
Ignacio Ferro
本文
  • ¡Abuelo! (Grandpa!), a two-page comic written for this recipe, in six languages · Postext Cookbook · CC BY 4.0
画像
  • Panorama of the crowded market hall: tiny Lola stands lost on the far left; far right, her grandfather searches the crowd. · Generated With Diffusion Models · オリジナル
  • Lola, tearful, stands among grown-ups' legs and shopping bags. · Generated With Diffusion Models · オリジナル
  • Paco stands on a fruit crate and whistles through his fingers; shoppers turn to look. · Generated With Diffusion Models · オリジナル
  • Lola leaps into her grandfather's arms; his beret flies off and the stallholders smile. · Generated With Diffusion Models · オリジナル
フォント
Patrick Hand (SIL OFL 1.1) · Bangers (SIL OFL 1.1) · Noto Sans SC (SIL OFL 1.1) · ZCOOL KuaiLe (SIL OFL 1.1) · Zen Antique (SIL OFL 1.1) · Dela Gothic One (SIL OFL 1.1) · Playpen Sans Arabic (SIL OFL 1.1) · Lalezar (SIL OFL 1.1)
SandboxPDF