Коротко
Две страницы комикса о буре: одна огромная картинка на всю первую страницу с маленькой картинкой девочки внутри, а дальше страница, где чайка вылетает из своей рамки.
Что получится
Две страницы из бури в The Porthcove Light. Первая — сплеш: один рисунок маяка в бурю уходит за все края страницы, а на его нижний угол положен маленький кадр в рамке, Майя у окна. Вторую открывает волна в вылет за три края; под ней чайка вылетает из кадра смотрителя через его рамку, а узкий кадр без картинки держит две подписи на ночном синем фоне. Обрезной формат американского комикса, 168 × 259 мм с вылетом 3 мм, страницы есть на десяти языках.
Рецепт отвечает на вопросы
- Как вывести кадр за край страницы или дать фигуре перекрыть его рамку?
Короткий ответ
// 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
};
Ингредиенты
- Возможности
- Вставки, вылеты и прорыв рамкиРисунок кадра и кадрированиеРазбиение на кадрыРамки кадров и промежуткиЗвукоподражанияСтраницы комиксовЛеттеринг комиксовЛеттеринг на других языкахСтили облачковБезопасная зона иллюстрацииСемантическая палитраСтраницы на холстеЭкспорт в PDF
- Шрифты
- Comic Neue, Bangers, Zen Antique, Dela Gothic One, ZCOOL KuaiLe, ZCOOL QingKe HuangYou, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
- Материалы
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, оригинал)
- 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 мм за обрез, без рамки на этих сторонах (деление страницы). На странице 2 bleed="top start end" у волны выводит за обрез только эти три стороны; снизу остаётся промежуток до кадров ниже. start и end следуют направлению чтения, поэтому японское и арабское издания, которые читаются справа налево, выводят те же стороны.
#2 · Положите вставку на сплеш
inset="56 64 38 30" ставит кадр Майи в точку 56 %, 64 % предыдущего кадра, шириной 38 % и глубиной 30 %. Вставка не занимает ячейку: она лежит поверх сплеша, сохраняет собственную рамку и читается сразу после него. Её картинка обрезается по рамке вставки с учётом безопасной зоны, здесь лица Майи.

#3 · Дайте чайке взломать рамку
// 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 называет вторую картинку кадра смотрителя: прозрачный PNG размером с его рисунок, на котором только чайка. Postext обрезает и ставит её точно так же, как рисунок кадра, а рисует после рамки и вне обрезки кадра, поэтому часть чайки за пределами ячейки летит поверх рамки и поля (кадры и рисунки). focus="45% 50%" сдвигает обрезку влево в пределах безопасной зоны, чтобы чайка сидела на левом краю, а не в поле.
#4 · Оставьте кадр без картинки
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' } },
];
::panel без art — пустая ячейка с рамкой стиля кадра; bg=night заливает её цветом палитры. Подписи at=top и at=bottom прижаты к верхнему и нижнему краю: тихая пауза после бури.
Рецепт целиком
// ═══ 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
Собранный 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)
Изменить описание рецепта ↗ (открывается в новой вкладке)Папка рецепта на GitHub ↗ (открывается в новой вкладке)


