In short
Two pages of a comic about a storm: one huge picture filling the whole first page with a small picture of a girl set into it, then a page where a gull flies out of its frame.
What you'll build
Two pages from the storm in The Porthcove Light. The first is a splash: one picture of the lighthouse in the storm runs off every edge of the page, with a small framed panel of Maya at her window laid over its lower corner. The second opens with a wave bled off three edges; under it, a gull flies out of the keeper's panel across its border, and a narrow panel with no picture holds two captions on a night-blue ground. The trim is an American comic book, 168 × 259 mm with 3 mm of bleed, and the pages come in ten languages.
This recipe answers
- How do I run a panel off the page edge or let a figure break its border?
The short answer
// 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
};
A bleed, an inset and a pop-out, written on the panels themselves
Ingredients
- Features
- Insets, bleeds and broken bordersPanel art and cropsPanel splitsPanel borders and guttersSound effectsComic pagesComic letteringRe-lettering in other languagesBalloon stylesPicture safe areaSemantic colour palettePages on a canvasPDF export
- Type
- Comic Neue, Bangers, Zen Antique, Dela Gothic One, ZCOOL KuaiLe, ZCOOL QingKe HuangYou, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
- Assets
sp-maya-face.jpgsp-splash.jpgsp-tomas-pop.pngsp-tomas.jpgsp-wave.jpg- Panel picture: the lighthouse in the storm (splash) (Generated With Diffusion Models, original)
- Panel picture: Maya at the window (inset) (Generated With Diffusion Models, original)
- Panel picture: the wave on the rocks (Generated With Diffusion Models, original)
- Panel picture: the keeper on the gallery (Generated With Diffusion Models, original)
- Panel picture: the gull flying over the border (transparent layer) (Generated With Diffusion Models, original)
Method
#1 · Bleed the splash off every edge
The code is the short answer above. split="*" makes one cell of the whole frame, and bleed on the page runs every panel that touches the frame out to the bleed box, 3 mm past the trim, with no border on those sides (splitting the page). On page 2, bleed="top start end" on the wave bleeds only those three sides; its foot keeps the gutter to the panels below. start and end follow the reading direction, so the Japanese and Arabic editions, read right to left, bleed the same sides.
#2 · Lay an inset over the splash
inset="56 64 38 30" places Maya's panel at 56%, 64% of the panel before it, 38% wide and 30% deep. An inset takes no cell: it is laid over the splash, keeps its own border and is read right after it. Its picture is cropped to its own box by its safe area, here Maya's face.

#3 · Let a gull break the border
// 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 names a second picture for the keeper's panel: a transparent PNG the size of his picture with only the gull on it. Postext crops and places it exactly like the panel's art, then draws it after the border and outside the panel's clip, so the part of the gull that lies beyond the cell flies over the border and the margin (panels and art). focus="45% 50%" slides the crop left inside what the safe area allows, so the gull sits across the left edge rather than out in the margin.
#4 · Leave a panel without a picture
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' } },
];
A ::panel with no art is an empty cell with the panel style's border; bg=night fills it with a palette colour. Its captions, at=top and at=bottom, are butted to its top and bottom edges, a quiet beat after the storm.
The whole recipe
// ═══ 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 = 'en'; // @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
The composed script.js runs as it is: paste it into any page’s module script, or open the recipe on CodePen. Recipe folder on GitHub ↗ (opens in a new tab)
Variations
#Bleed the whole bottom tier as well
-::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"}#Give the inset a white frame
A named panel style changes one panel; style= on the panel picks it.
panel: { borderWidth: pt(1.2), borderColor: col('ink'), background: col('paper') },
+ panelStyles: [{ id: 'framed', borderWidth: pt(3), borderColor: col('paper') }],Pitfalls
- The pop layer must have exactly the panel picture's pixel size: Postext crops it with the same window, so a smaller cut-out would land in the wrong place.
- Bleed needs
page.bleed; without it a bleeding panel stops at the trim. - A sound effect beside a bleeding edge may run into the bleed, past the trim, where the guillotine cuts it. The Japanese ザッバーン is a column five characters tall, so it is pinned lower than the Latin effects, at
60% 44%.
Credits
- Recipe
- Ignacio Ferro
- Text
- Original prose, CC BY 4.0
- Images
- Panel picture: the lighthouse in the storm (splash) · Generated With Diffusion Models · original
- Panel picture: Maya at the window (inset) · Generated With Diffusion Models · original
- Panel picture: the wave on the rocks · Generated With Diffusion Models · original
- Panel picture: the keeper on the gallery · Generated With Diffusion Models · original
- Panel picture: the gull flying over the border (transparent layer) · Generated With Diffusion Models · original
- Fonts
- 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)
Edit this write-up ↗ (opens in a new tab)Recipe folder on GitHub ↗ (opens in a new tab)


