انتقل إلى المحتوى الرئيسي
الوصفة رقم 147

دليل الوصفات · الفصل 11 · القصص المصوّرة والمانغا

صفحة كاملة، وإطار مُدرج، وحافة مكسورة

عاصفة في صفحتين مصوّرتين: صورة كاملة تنزف خارج الحواف فوقها إطار مُدرج، وصفّ ينزف من ثلاث جهات، ونورس يطير عبر حافة إطاره، وإطار ليس فيه إلا مربعات السرد.

في هذه الصفحة
المُخرَج
Canvas · PDF
المستوى
متوسط
Postext
اختُبرت مع Postext 1.65.0
تتطلب ≥ 1.25.0 · postext-pdf ≥ 1.25.0
الترخيص
حُدّثت في 10 أكتوبر 2026
الشيفرة MIT · النص CC BY 4.0
  • مقاس القص 168 × 259 مم
  • عمود واحد
  • Playpen Sans Arabic 10/14
  • صفحتان
  • المستوى
  • Postext 1.65.0
  • أُخرجت في 105 ms
  • أسطر الشيفرة: 116

باختصار

صفحتان من قصة مصوّرة عن عاصفة: صورة ضخمة تملأ الصفحة الأولى كلها وفوقها إطار صغير لفتاة، ثم صفحة يطير فيها نورس خارج إطاره.

ما الذي ستنضده

صفحتان من عاصفة منارة بورثكوف. الأولى صفحة كاملة: صورة واحدة للمنارة في العاصفة تمتد خارج كل حواف الصفحة، وفوق زاويتها السفلى إطار صغير مؤطّر لمايا عند نافذتها. والثانية تبدأ بموجة تنزف من ثلاث جهات؛ وتحتها نورس يخرج من إطار الحارس عابرًا حافته، وإطار ضيّق بلا صورة فيه مربعا سرد على أرضية بلون الليل. المقاس مقاس كتاب مصوّر أمريكي، ‎168 × 259 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 على الصفحة كل إطار يلمس الإطار العام حتى مستطيل النزف، ٣ مم بعد خط القص، بلا حدود على تلك الجهات (تقسيم الصفحة). وفي الصفحة ٢، تجعل bleed="top start end" على الموجة هذه الجهات الثلاث وحدها تنزف، ويبقى بين أسفلها والإطارات التي تحتها فاصل. وstart وend تتبعان اتجاه القراءة، فتنزف الطبعتان اليابانية والعربية، وهما تُقرآن من اليمين إلى اليسار، من الجهات نفسها.

#2 · ضع إطارًا مُدرجًا فوق الصفحة الكاملة

تضع inset="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 إلى إطار الحارس صورة ثانية: ملف 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' } },
];

الإطار ::panel الذي ليس فيه art خلية فارغة بحدود نمط الإطار؛ و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 = 'ar'; // @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 المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على 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)
الشيفرة
MIT، مثل Postext
SandboxPDF