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

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

スプラッシュページ、小ゴマ、枠破り

嵐を描いた漫画2ページ。裁ち切りのスプラッシュに小ゴマを重ね、三方を裁ち切った段、枠を越えて飛ぶカモメ、ナレーションだけのコマを組みます。

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

1ページ(全2ページ)

  • 仕上がり168 × 259 mm
  • 1段
  • Zen Antique 10/14
  • 2ページ
  • レベル
  • Postext 1.65.0
  • 組版時間135 ms
  • コード116行

かんたんな説明

嵐の漫画の2ページ。1ページ目は一枚の大きな絵がページ全体を埋め、その上に女の子の小さなコマが重なります。2ページ目では、カモメがコマの枠から飛び出します。

できあがり

『ポースコーヴの灯』の嵐の2ページです。1ページ目はスプラッシュで、嵐の中の灯台を描いた一枚の絵がページの四方の外まで広がり、下の角に窓辺のマヤを描いた枠つきの小ゴマが重なります。2ページ目は三方を裁ち切った波で始まり、その下で一羽のカモメが灯台守のコマから枠を越えて飛び出します。絵のない細いコマには、紺色の地にナレーションが二つ。判型はアメリカのコミックブックの168 × 259 mm、塗り足し3 mmで、十言語で出ます。

このレシピが答える質問

  • コマを裁ち切りにしたり、人物を枠線からはみ出させたりするには?

手短な答え

script.js · 44〜64行コード全体で見る
// In the Markdown, the panel attributes do the work:
//   :::page{split="*" bleed}                 one panel, every edge bled off the page
//   ::panel{art=sp-maya-face inset="56 64 38 30"}   over the panel before it: x y w h in %
//   ::panel{art=sp-wave bleed="top start end"}      only the edges that touch the trim
//   ::panel{art=sp-tomas pop=sp-tomas-pop}   a transparent layer drawn over the border
//   ::panel{bg=night}                        no picture: captions on a palette colour
// A bleeding panel runs to the bleed box, 3 mm past the trim, and loses its border on those
// sides. The pop layer is cropped and placed exactly like the panel's picture, then drawn
// after the border without the panel's clip, so whatever it holds outside the cell shows.
const comics = {
  gutter: { horizontal: mm(4), vertical: mm(3) },
  panel: { borderWidth: pt(1.2), borderColor: col('ink'), background: col('paper') },
  lettering: { fontFamily: LETTERING, fontSize: pt(8.5), color: col('ink'), inset: mm(2) },
  balloonStyles: [
    { id: 'speech', stroke: col('ink') },
    { id: 'caption', fill: col('lamp'), stroke: col('ink') },
    { id: 'inner', fill: col('paper'), stroke: col('ink') },
    { id: 'sfx', fontFamily: SFX, color: col('accent'), haloColor: col('ink'), halo: pt(2) },
  ],
  runningHeads: true, // a comic page has no running head unless asked: here, its folio
};

材料

種類
Comic Neue, Bangers, Zen Antique, Dela Gothic One, ZCOOL KuaiLe, ZCOOL QingKe HuangYou, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
素材
  • sp-maya-face.jpg
  • sp-splash.jpg
  • sp-tomas-pop.png
  • sp-tomas.jpg
  • sp-wave.jpg
  • Panel picture: the lighthouse in the storm (splash) (Generated With Diffusion Models, オリジナル)
  • Panel picture: Maya at the window (inset) (Generated With Diffusion Models, オリジナル)
  • Panel picture: the wave on the rocks (Generated With Diffusion Models, オリジナル)
  • Panel picture: the keeper on the gallery (Generated With Diffusion Models, オリジナル)
  • Panel picture: the gull flying over the border (transparent layer) (Generated With Diffusion Models, オリジナル)

作り方

#1 · スプラッシュを四方とも裁ち切りにする

コードは前の手短な答えにあります。split="*"で枠全体を一つのセルにし、ページのbleedで枠に接するコマをすべて仕上がり線の3 mm外の塗り足しの端まで伸ばします。その辺には枠線を描きません(ページの分割)。2ページ目の波のコマはbleed="top start end"で、その三辺だけを裁ち切りにし、下の辺は下のコマとの間白を残します。startとendは読む方向に従うので、右から左へ読む日本語版とアラビア語版でも同じ辺が裁ち切りになります。

#2 · スプラッシュに小ゴマを重ねる

inset="56 64 38 30"は、マヤのコマを直前のコマの56%、64%の位置に、幅38%、高さ30%で置きます。小ゴマはセルを使いません。スプラッシュの上に重なり、自分の枠線を描き、スプラッシュのすぐ後に読まれます。絵は自分のセーフエリア(ここではマヤの顔)に従って、自分の枠に合わせて切り抜かれます。

小ゴマ。スプラッシュの右下に重ねた枠の中のマヤの顔と、心の声。

#3 · カモメに枠を破らせる

script.js · 111〜197行コード全体で見る
// From the art manifest; fractions of each picture, the same in every language. The gull's
// layer is a transparent PNG the size of the keeper's picture, so it shares its crop.
const face = (x, y, width, height) => ({ x, y, width, height });
const ART = {
  'sp-splash': { width: 708, height: 1000, safeArea: face(0.26, 0.14, 0.6, 0.48),
    anchors: [{ id: 'sfx', x: 0.82, y: 0.4 }], avoid: [face(0.28, 0.15, 0.17, 0.35)] },
  'sp-maya-face': { width: 1000, height: 1000, safeArea: face(0.33, 0.26, 0.35, 0.34),
    anchors: [{ id: 'maya', x: 0.52, y: 0.48, face: face(0.37, 0.27, 0.29, 0.31) }] },
  'sp-wave': { width: 1400, height: 600, safeArea: face(0.4, 0.12, 0.53, 0.6),
    anchors: [{ id: 'sfx', x: 0.6, y: 0.35 }], avoid: [face(0.82, 0.02, 0.06, 0.3)] },
  'sp-tomas': { width: 1000, height: 1000, safeArea: face(0.22, 0.13, 0.6, 0.49),
    anchors: [{ id: 'tomas', x: 0.63, y: 0.345, head: { x: 0.67, y: 0.24 },
      face: face(0.56, 0.17, 0.24, 0.25) }], avoid: [face(0.32, 0.13, 0.15, 0.33)] },
  'sp-tomas-pop': { width: 1000, height: 1000 },
};
const ALT = {
  'sp-splash': t({ en: 'The red-and-white lighthouse in a night storm, waves exploding on the '
      + 'rocks, its beam cutting through the rain, lightning behind.',
    es: 'El faro rojo y blanco en una noche de tormenta: las olas revientan en las rocas, el haz '
      + 'corta la lluvia y detrás cae un rayo.',
    ca: 'El far vermell i blanc en una nit de tempesta: les onades esclaten a les roques, el feix '
      + 'talla la pluja i al darrere cau un llamp.',
    zh: '暴风雨之夜,红白相间的灯塔,浪头在礁石上炸开,光束穿过雨幕,后面是闪电。',
    ar: 'المنارة الحمراء والبيضاء في ليلة عاصفة، والموج يتفجّر على الصخور، وشعاعها يشقّ المطر، '
      + 'وخلفها برق.',
    ja: '嵐の夜の赤と白の灯台。岩に波が砕け、光の帯が雨を切り裂き、後ろで稲妻が光る。',
    pt: 'O farol vermelho e branco numa noite de tempestade: as ondas arrebentam nas pedras, o '
      + 'facho corta a chuva e, atrás, cai um raio.',
    fr: 'Le phare rouge et blanc par une nuit de tempête : les vagues explosent sur les rochers, '
      + 'le faisceau fend la pluie et, derrière, un éclair.',
    de: 'Der rot-weiße Leuchtturm in einer Sturmnacht: Wellen explodieren an den Felsen, sein '
      + 'Strahl schneidet durch den Regen, dahinter ein Blitz.',
    it: 'Il faro bianco e rosso in una notte di tempesta: le onde si infrangono sugli '
      + 'scogli, il fascio di luce taglia la pioggia e, dietro, cade un fulmine.' }),
  'sp-maya-face': t({ en: 'Maya’s face behind a rain-streaked window, hood up, lit by the lamp.',
    es: 'La cara de Maya tras una ventana surcada de lluvia, con la capucha puesta y la luz de la '
      + 'lámpara.',
    ca: 'La cara de la Maya darrere una finestra plena de pluja, amb la caputxa posada i la llum '
      + 'del llum.',
    zh: '玛雅戴着兜帽,脸贴在满是雨痕的窗后,被灯光照亮。',
    ar: 'وجه مايا خلف نافذة يسيل عليها المطر، والقلنسوة على رأسها، ونور المصباح عليها.',
    ja: '雨の筋が流れる窓の向こうに、フードをかぶったマヤの顔。ランプの光に照らされている。',
    pt: 'O rosto de Maya atrás de uma janela riscada de chuva, de capuz, à luz da lamparina.',
    fr: 'Le visage de Maya derrière une vitre striée de pluie, capuche sur la tête, à la lueur de '
      + 'la lampe.',
    de: 'Mayas Gesicht hinter einem regenüberströmten Fenster, die Kapuze auf, vom Licht der '
      + 'Lampe beleuchtet.',
    it: 'Il volto di Maya dietro una finestra rigata di pioggia, col cappuccio alzato, '
      + 'alla luce della lampada.' }),
  'sp-wave': t({ en: 'A huge wave bursts over black rocks below the lighthouse at night.',
    es: 'Una ola enorme revienta sobre las rocas negras al pie del faro, de noche.',
    ca: 'Una onada enorme esclata sobre les roques negres al peu del far, de nit.',
    zh: '夜里,一道巨浪在灯塔下的黑色礁石上炸开。',
    ar: 'موجة هائلة تتفجّر ليلًا فوق الصخور السوداء تحت المنارة.',
    ja: '夜、灯台の下の黒い岩に巨大な波が砕け散る。',
    pt: 'Uma onda enorme arrebenta nas pedras negras ao pé do farol, à noite.',
    fr: 'Une vague énorme se brise sur les rochers noirs au pied du phare, la nuit.',
    de: 'Eine gewaltige Welle bricht nachts über die schwarzen Felsen unter dem Leuchtturm.',
    it: 'Un’onda enorme si abbatte sugli scogli neri ai piedi del faro, di notte.' }),
  'sp-tomas': t({ en: 'The keeper in an oilskin on the lantern gallery holds up a storm lantern, '
      + 'his beard whipping in the wind.',
    es: 'El farero, con impermeable de hule en la galería, levanta un farol; el viento le agita '
      + 'la barba.',
    ca: 'El faroner, amb impermeable d’hule a la galeria, aixeca un fanal; el vent li remena la '
      + 'barba.',
    zh: '守塔人穿着油布雨衣站在灯室回廊上,高举一盏防风灯,胡子被风吹得乱飞。',
    ar: 'الحارس بمعطفه المشمّع على شرفة الفانوس يرفع مصباح العاصفة، والريح تعبث بلحيته.',
    ja: '油合羽の灯台守が回廊でカンテラを掲げる。ひげが風にあおられている。',
    pt: 'O faroleiro, de capa impermeável na galeria, ergue um lampião; o vento agita a barba '
      + 'dele.',
    fr: 'Le gardien, en ciré sur la galerie du phare, brandit une lanterne ; le vent lui fouette '
      + 'la barbe.',
    de: 'Der Wärter in Ölzeug hebt auf der Galerie der Laterne eine Sturmlaterne; der Wind '
      + 'peitscht ihm den Bart.',
    it: 'Il guardiano del faro, in cerata sul ballatoio, solleva una lanterna; il vento '
      + 'gli sferza la barba.' }),
  'sp-tomas-pop': t({ en: 'A herring gull flies out across the panel’s left border.',
    es: 'Una gaviota sale volando por el borde izquierdo de la viñeta.',
    ca: 'Una gavina surt volant per la vora esquerra de la vinyeta.',
    zh: '一只银鸥飞出格子的左边框。',
    ar: 'نورس فضي يطير خارجًا عبر الحافة اليسرى للإطار.',
    ja: 'セグロカモメがコマの左の枠を越えて飛んでいく。',
    pt: 'Uma gaivota sai voando pela borda esquerda do quadro.',
    fr: 'Une mouette s’envole par-dessus le bord gauche de la case.',
    de: 'Eine Silbermöwe fliegt über den linken Rand des Panels hinaus.',
    it: 'Un gabbiano esce in volo oltre il bordo sinistro della vignetta.' }),
};

pop=sp-tomas-popは灯台守のコマに2枚目の絵を与えます。彼の絵と同じ大きさの透明なPNGで、カモメだけが描かれています。Postextはこれをコマの絵とまったく同じように切り抜いて置き、枠線の後に、コマの切り抜きの外まで描きます。そのため、セルの外にはみ出したカモメの部分が枠線と余白の上を飛びます(コマと絵)。focus="45% 50%"はセーフエリアが許す範囲でトリミングを左へずらし、カモメが余白に出てしまわず、左の枠をまたぐようにします。

#4 · 絵のないコマを置く

script.js · 19〜31行コード全体で見る
const palette = {
  ink: '#141b24', // panel borders and lettering
  night: '#1d2a3a', // the ground of the text-only panel
  lamp: '#f2c14e', // the captions: the colour of the lantern
  accent: '#e9f0f5', // sound effects: surf white, outlined in ink
  muted: '#5c6672', // folios
  paper: '#fbfaf7',
};
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' } },
];

artのない::panelは、コマのスタイルの枠線だけの空のセルです。bg=nightはそれをパレットの色で塗ります。ナレーションはat=topとat=bottomで上下の辺に寄せ、嵐の後のひと呼吸にします。

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 147 · A splash page, an inset and a broken border ═══════
// https://postext.dev/en/cookbook/splash-inset-broken-border
// Code: MIT · Text: original (CC BY 4.0) · Pictures: generated with diffusion models
// Fonts: Comic Neue, Bangers and the faces of five editions (OFL) · Needs postext ≥ 1.25.0
//
// Two pages of a storm: a splash page that bleeds off all four edges with a small inset panel
// laid over it, then a page whose top tier bleeds off three edges, whose second panel lets a
// gull fly out over its border, and whose last panel holds only captions on a night-blue ground.
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, registerResourceImage, loadVerticalAlternates,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'ja'; // @lang: 'en' | 'es' | 'ca' | 'zh' | 'ar' | 'ja' | 'pt' | 'fr' | 'de' | 'it'
const RECIPE = 'splash-inset-broken-border';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: storm blue, lamplight and the white of the surf
const palette = {
  ink: '#141b24', // panel borders and lettering
  night: '#1d2a3a', // the ground of the text-only panel
  lamp: '#f2c14e', // the captions: the colour of the lantern
  accent: '#e9f0f5', // sound effects: surf white, outlined in ink
  muted: '#5c6672', // folios
  paper: '#fbfaf7',
};
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

// #region editions: six editions, each lettered in faces for its script
const [LETTERING, SFX] = t({
  en: ['Comic Neue', 'Bangers'], es: ['Comic Neue', 'Bangers'], ca: ['Comic Neue', 'Bangers'],
  ja: ['Zen Antique', 'Dela Gothic One'], zh: ['ZCOOL KuaiLe', 'ZCOOL QingKe HuangYou'],
  ar: ['Playpen Sans Arabic', 'Lalezar'], pt: ['Comic Neue', 'Bangers'],
  fr: ['Comic Neue', 'Bangers'], de: ['Comic Neue', 'Bangers'], it: ['Comic Neue', 'Bangers'],
});
// #endregion

// #region answer: a bleed, an inset and a pop-out, written on the panels themselves
// In the Markdown, the panel attributes do the work:
//   :::page{split="*" bleed}                 one panel, every edge bled off the page
//   ::panel{art=sp-maya-face inset="56 64 38 30"}   over the panel before it: x y w h in %
//   ::panel{art=sp-wave bleed="top start end"}      only the edges that touch the trim
//   ::panel{art=sp-tomas pop=sp-tomas-pop}   a transparent layer drawn over the border

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

アレンジ

#下の段も裁ち切りにする

-::panel{art=sp-tomas pop=sp-tomas-pop focus="45% 50%"}
+::panel{art=sp-tomas pop=sp-tomas-pop focus="45% 50%" bleed="bottom start"}

#小ゴマに白い縁を付ける

名前つきのコマのスタイルは一つのコマだけを変えます。コマのstyle=で選びます。

   panel: { borderWidth: pt(1.2), borderColor: col('ink'), background: col('paper') },
+  panelStyles: [{ id: 'framed', borderWidth: pt(3), borderColor: col('paper') }],

よくあるつまずき

  • 枠破り用のレイヤーは、コマの絵とまったく同じピクセルサイズにします。Postextは同じ窓で切り抜くので、小さい切り抜きでは別の場所に置かれてしまいます。
  • 裁ち切りにはpage.bleedが必要です。ないと、裁ち切りのコマは仕上がり線で止まります。
  • 裁ち切りの辺のそばの描き文字は、仕上がり線の外の塗り足し部分に入り、断裁で切られることがあります。日本語版の「ザッバーン」は五文字の縦の行なので、ラテン文字の描き文字より低い60% 44%に固定しています。

クレジット

レシピ
Ignacio Ferro
本文
書き下ろしの文章, CC BY 4.0
画像
  • Panel picture: the lighthouse in the storm (splash) · Generated With Diffusion Models · オリジナル
  • Panel picture: Maya at the window (inset) · Generated With Diffusion Models · オリジナル
  • Panel picture: the wave on the rocks · Generated With Diffusion Models · オリジナル
  • Panel picture: the keeper on the gallery · Generated With Diffusion Models · オリジナル
  • Panel picture: the gull flying over the border (transparent layer) · Generated With Diffusion Models · オリジナル
フォント
Comic Neue (SIL OFL 1.1) · Bangers (SIL OFL 1.1) · Zen Antique (SIL OFL 1.1) · Dela Gothic One (SIL OFL 1.1) · ZCOOL KuaiLe (SIL OFL 1.1) · ZCOOL QingKe HuangYou (SIL OFL 1.1) · Playpen Sans Arabic (SIL OFL 1.1) · Lalezar (SIL OFL 1.1)
SandboxPDF