باختصار
صفحة قصة مصوّرة رُسمت مرة واحدة ورُتّبت بثلاث طرق. الصور الخمس نفسها والحوار نفسه يملآن ثلاث شبكات مختلفة من الإطارات، وتُقصّ كل صورة من جديد لتناسب إطارها.
ما الذي ستنضده
بروفة تصميم لصفحة واحدة من قصة مصوّرة، منارة بورثكوف: غلاف، ثم الصفحة نفسها بثلاثة تقسيمات ليختار المؤلف منها. الصور الخمس (مايا تصعد إلى المنارة، وجدّها أمام مذياع صامت، ومايا تشير إلى الأرض، والقط نائم على السلك، والفانوس مضاء ليلًا) والعبارات الست المكتوبة لا تتغيّر؛ الذي يتغيّر هو split في كل :::page فقط. تُقصّ كل صورة من جديد لإطارها، وتوضع كل فقاعة من جديد قرب الشخصية المتكلمة. المقاس مقاس كتاب مصوّر أمريكي، 168 × 259 mm، وللبروفة عشر طبعات، تُكتب حوارات كل منها بلغتها.
تجيب هذه الوصفة عن
- كيف أقسّم صفحة إلى إطارات قصة مصورة؟
- كيف أُبقي الوجه ظاهرًا حين يقصّ الإطار الصورة؟
- كيف أعيد كتابة نصوص قصة مصورة بلغة أخرى؟
الجواب المختصر
// Every :::page fills the type area; its split attribute cuts it into cells and its ::panel
// lines fill them in reading order (rows top to bottom, columns from the start side):
// :::page{split="30 / 35 [* | * | *] / *"} three tiers, the middle one in three
// :::page{split="60 [* / *] | * [* / * / *]"} two columns, then each column in tiers
// :::page{split="30 [30 | 20 | *] / *"} a 30 % tier cut 30 | 20 | rest, then the rest
// A size is a percentage of the parent cell, * shares what is left, [ … ] cuts that cell
// on the other axis. A panel with inset="x y w h" sits over the panel before it.
const comics = {
gutter: { horizontal: mm(4), vertical: mm(3) }, // between tiers, between panels in a tier
panel: { borderWidth: pt(1), borderColor: col('ink'), background: col('paper') },
lettering: { fontFamily: LETTERING, fontSize: pt(8), color: col('ink'), inset: mm(1) },
balloonStyles: [
{ id: 'speech', stroke: col('ink') },
{ id: 'caption', fill: col('caption'), stroke: col('ink') },
{ id: 'sfx', fontFamily: SFX, color: col('accent'), haloColor: col('paper') },
],
runningHeads: true, // a comic page has no running head unless asked: here, its folio
};
المكونات
- الميزات
- تقسيم الإطاراترسم الإطار وقصّهالشخصيات ونقاط الارتكازالمنطقة الآمنة في الصورةحدود الإطارات والفواصلصفحات القصص المصورةكتابة نصوص القصص المصورةإعادة كتابة النصوص بلغات أخرىأنماط الفقاعاتالمؤثرات الصوتيةلوحة ألوان دلاليةصفحات على اللوحة (Canvas)التصدير إلى PDF
- تستخدم أيضًا
- فقرات بالاتجاه المعاكسالإطارات المضمّنة والممتدة والمكسورة الحدودأشكال الأرقام في الأعداد المولَّدةلون الورقأنماط الفقراتالخطوط المضمَّنة في PDFالأشكال والجداول بوصفها مواردكتب مجلّدة من اليمينالنص من اليمين إلى اليسار
- الخطوط
- Comic Neue, Bangers, Zen Antique, Dela Gothic One, ZCOOL KuaiLe, ZCOOL QingKe HuangYou, Playpen Sans Arabic, Lalezar (SIL OFL 1.1)
- الأصول
lh-arrive.jpglh-beam.jpglh-biscuit.jpglh-maya.jpglh-radio.jpg- Panel picture: Maya arrives at the lighthouse (Generated With Diffusion Models, أصلي)
- Panel picture: Tomás at the radio (Generated With Diffusion Models, أصلي)
- Panel picture: Maya finds the problem (Generated With Diffusion Models, أصلي)
- Panel picture: Biscuit asleep on the cable (Generated With Diffusion Models, أصلي)
- Panel picture: the lamp lit at night (Generated With Diffusion Models, أصلي)
طريقة التحضير
#1 · اقسم الصفحة بشجرة تقسيم
الشيفرة هي الجواب المختصر في الأعلى. يملأ :::page مساحة النص في الصفحة، وهي هنا 144 × 227 mm، وتقسمها سمته split. الرمز / يفصل الصفوف، و| يفصل الأعمدة، وكل مقاس نسبة مئوية من الخلية التي يقسمها، و* يوزّع الباقي، والقوسان المعقوفان يقسمان تلك الخلية من جديد على المحور الآخر (تقسيم الصفحة). التقسيم ج، 30 [30 | 20 | *] / *، يصنع صفًّا بعمق ٣٠٪، ويقسمه إلى خلايا بعرض ٣٠٪ و٢٠٪ والباقي، ويترك تحته خلية طويلة واحدة. تتوزّع الفواصل على جانبي كل خط: ٤ مم بين الصفوف، و٣ مم بين الإطارات في الصف الواحد. تملأ أسطر ::panel الخلايا بترتيب القراءة: الصفوف من الأعلى، والأعمدة من جهة البداية.

#2 · أعطِ كل صورة منطقة آمنة
// From the art manifest; fractions of each picture, the same in every language. The safe
// area is what every crop keeps: Tomás alone, not his radio, so a cell a fifth of the page
// wide still shows him; the lighthouse and the gallery, not the boat, so a tall cell holds them.
const ART = {
'lh-arrive': { width: 1100, height: 733, safeArea: { x: 0.22, y: 0.08, width: 0.4, height: 0.64 },
anchors: [{ id: 'maya', x: 0.29, y: 0.52, head: { x: 0.27, y: 0.47 },
face: { x: 0.22, y: 0.42, width: 0.12, height: 0.16 } },
{ id: 'biscuit', x: 0.4, y: 0.68, face: { x: 0.37, y: 0.64, width: 0.07, height: 0.08 } }],
avoid: [{ x: 0.51, y: 0.09, width: 0.1, height: 0.43 }],
alt: t({ en: 'A girl in a yellow raincoat walks up a coastal path towards a red-and-white '
+ 'lighthouse, a fat orange cat ahead of her.',
es: 'Una niña con chubasquero amarillo sube por un camino de costa hacia un faro rojo y '
+ 'blanco, con un gato naranja gordo delante.',
ca: 'Una nena amb impermeable groc puja per un camí de costa cap a un far vermell i blanc, '
+ 'amb un gat taronja gras al davant.',
zh: '一个穿黄色雨衣的女孩沿着海边小路走向红白相间的灯塔,一只胖胖的橘猫走在前面。',
ar: 'فتاة بمعطف مطر أصفر تصعد دربًا ساحليًا نحو منارة حمراء وبيضاء، وأمامها قط برتقالي سمين.',
ja: '黄色いレインコートの女の子が、赤と白の灯台へ続く海辺の小道をのぼっていく。前を太ったオレンジ色の猫が歩く。',
pt: 'Uma menina de capa de chuva amarela sobe um caminho à beira-mar rumo a um farol '
+ 'vermelho e branco, com um gato laranja gordo à frente.',
fr: 'Une fillette en ciré jaune monte un sentier côtier vers un phare rouge et blanc, '
+ 'précédée d’un gros chat roux.',
de: 'Ein Mädchen in gelbem Regenmantel geht einen Küstenpfad zu einem rot-weißen '
+ 'Leuchtturm hinauf, eine dicke rote Katze vor ihr.',
it: 'Una bambina con l’impermeabile giallo sale per un sentiero costiero verso un faro '
+ 'bianco e rosso, preceduta da un grosso gatto rosso.' }) },
'lh-radio': { width: 1000, height: 1000,
safeArea: { x: 0.27, y: 0.38, width: 0.24, height: 0.3 },
anchors: [{ id: 'tomas', x: 0.345, y: 0.52, head: { x: 0.38, y: 0.44 },
face: { x: 0.29, y: 0.4, width: 0.16, height: 0.18 } }],
avoid: [{ x: 0, y: 0.44, width: 0.22, height: 0.26 }],
alt: t({ en: 'The old keeper, white-bearded, in a navy sweater and cap, taps a valve radio '
+ 'with the microphone in his hand.',
es: 'El viejo farero, de barba blanca, jersey azul marino y gorra, golpea una radio de '
+ 'válvulas con el micrófono en la mano.',
ca: 'El vell faroner, de barba blanca, jersei blau marí i gorra, pica una ràdio de vàlvules '
+ 'amb el micròfon a la mà.',
zh: '白胡子的老守塔人穿着藏青色毛衣、戴着帽子,手握话筒,敲着一台电子管收音机。',
ar: 'حارس المنارة العجوز بلحيته البيضاء وكنزته الكحلية وقبعته ينقر على مذياع قديم '
+ 'والميكروفون في يده.',
ja: '白いひげの老灯台守が、紺のセーターに帽子姿でマイクを握り、真空管ラジオをたたいている。',
pt: 'O velho faroleiro, de barba branca, suéter azul-marinho e boné, dá batidinhas num '
+ 'rádio valvulado com o microfone na mão.',
fr: 'Le vieux gardien, barbe blanche, pull bleu marine et casquette, tapote une radio à '
+ 'lampes, le micro à la main.',
de: 'Der alte Wärter mit weißem Bart, marineblauem Pullover und Mütze klopft auf ein '
+ 'Röhrenradio, das Mikrofon in der Hand.',
it: 'Il vecchio guardiano, barba bianca, maglione blu e berretto, picchietta su una radio a '
+ 'valvole con il microfono in mano.' }) },
'lh-maya': { width: 1100, height: 1100, safeArea: { x: 0.25, y: 0.27, width: 0.41, height: 0.68 },
anchors: [{ id: 'maya', x: 0.54, y: 0.565, head: { x: 0.5, y: 0.3 },
face: { x: 0.4, y: 0.33, width: 0.24, height: 0.29 } }],
avoid: [{ x: 0.27, y: 0.73, width: 0.25, height: 0.22 }],
alt: t({ en: 'Close-up of Maya frowning at the floor and pointing down.',
es: 'Primer plano de Maya, que frunce el ceño mirando al suelo y señala hacia abajo.',
ca: 'Primer pla de la Maya, que arrufa les celles mirant a terra i assenyala avall.',
zh: '玛雅的特写:她皱着眉头看着地板,手指向下指。',
ar: 'لقطة قريبة لمايا وهي تعقد حاجبيها ناظرةً إلى الأرض وتشير إلى أسفل.',
ja: 'マヤのアップ。眉をひそめて床を見つめ、下を指さしている。',
pt: 'Close de Maya, de testa franzida, olhando para o chão e apontando para baixo.',
fr: 'Gros plan sur Maya, sourcils froncés, qui fixe le sol et pointe le doigt vers le '
+ 'bas.',
de: 'Nahaufnahme von Maya, die mit gerunzelter Stirn auf den Boden blickt und nach unten '
+ 'zeigt.',
it: 'Primo piano di Maya, accigliata, che fissa il pavimento e indica in basso.' }) },
'lh-biscuit': { width: 1000, height: 1000,
safeArea: { x: 0.58, y: 0.25, width: 0.42, height: 0.33 },
anchors: [{ id: 'biscuit', x: 0.72, y: 0.355, head: { x: 0.73, y: 0.32 },
face: { x: 0.64, y: 0.27, width: 0.2, height: 0.18 } }],
avoid: [{ x: 0.93, y: 0.28, width: 0.07, height: 0.24 },
{ x: 0, y: 0.72, width: 0.4, height: 0.1 }],
alt: t({ en: 'Under the desk the fat orange cat sleeps on his back, right on top of the black '
+ 'radio cable.',
es: 'Bajo la mesa, el gato naranja gordo duerme panza arriba justo encima del cable negro '
+ 'de la radio.',
ca: 'Sota la taula, el gat taronja gras dorm panxa enlaire just a sobre del cable negre de '
+ 'la ràdio.',
zh: '桌子底下,胖橘猫四脚朝天地睡着,正好压在收音机的黑色电线上。',
ar: 'تحت المكتب ينام القط البرتقالي السمين على ظهره فوق سلك المذياع الأسود تمامًا.',
ja: '机の下で、太ったオレンジ色の猫がラジオの黒いコードの真上にあおむけで眠っている。',
pt: 'Debaixo da mesa, o gato laranja gordo dorme de barriga para cima bem em cima do cabo '
+ 'preto do rádio.',
fr: 'Sous le bureau, le gros chat roux dort sur le dos, juste sur le câble noir de la '
+ 'radio.',
it: 'Sotto la scrivania, il grosso gatto rosso dorme a pancia in su, proprio sopra il cavo '
+ 'nero della radio.',
de: 'Unter dem Schreibtisch schläft die dicke rote Katze auf dem Rücken, genau auf dem '
+ 'schwarzen Kabel des Funkgeräts.' }) },
'lh-beam': { width: 1200, height: 800, safeArea: { x: 0.15, y: 0.01, width: 0.25, height: 0.3 },
anchors: [{ id: 'maya', x: 0.235, y: 0.15,
face: { x: 0.21, y: 0.11, width: 0.05, height: 0.07 } },
{ id: 'tomas', x: 0.3, y: 0.145, face: { x: 0.28, y: 0.11, width: 0.04, height: 0.06 } }],
avoid: [{ x: 0.79, y: 0.55, width: 0.08, height: 0.09 }],
alt: t({ en: 'Night: the beam sweeps over a dark sea; Maya and her grandfather stand on the '
+ 'lantern gallery and a fishing boat shows its lights far out.',
es: 'De noche, el haz barre un mar oscuro; Maya y su abuelo están en la galería de la '
+ 'linterna y a lo lejos se ven las luces de un pesquero.',
ca: 'De nit, el feix escombra un mar fosc; la Maya i el seu avi són a la galeria de la '
+ 'llanterna i lluny es veuen els llums d’un pesquer.',
zh: '夜里,灯塔的光束扫过漆黑的海面;玛雅和外公站在灯室外的回廊上,远处一艘渔船亮着灯。',
ar: 'ليلًا يمسح الشعاع بحرًا مظلمًا، ومايا وجدّها واقفان على شرفة الفانوس، وفي البعيد قارب '
+ 'صيد بأضوائه.',
ja: '夜。光の帯が暗い海をなでる。マヤと祖父は灯室の回廊に立ち、沖には漁船の明かりが見える。',
pt: 'À noite, o facho varre um mar escuro; Maya e o avô estão na galeria da lanterna e, ao '
+ 'longe, aparecem as luzes de um barco de pesca.',
fr: 'La nuit, le faisceau balaie une mer sombre ; Maya et son grand-père se tiennent sur '
+ 'la galerie de la lanterne et, au large, un bateau de pêche montre ses feux.',
de: 'Nacht: Der Lichtstrahl streicht über ein dunkles Meer; Maya und ihr Großvater stehen '
+ 'auf der Galerie der Laterne, und weit draußen zeigt ein Fischerboot seine Lichter.',
it: 'Di notte il fascio di luce spazza un mare scuro; Maya e suo nonno sono sulla balconata '
+ 'della lanterna e, al largo, si vedono le luci di un peschereccio.' }) },
};
تُرسم كل صورة مرة واحدة وتُقصّ لتملأ الخلية التي تقع فيها. المنطقة الآمنة هي الجزء الذي يبقى كاملًا في كل قصّ (الإطارات والرسوم). المنطقة الآمنة لصورة المذياع هي الحارس وحده، ٢٤٪ من عرضها، فتُظهره الخلية التي عرضها ٢٦ مم في التقسيم ج من القبعة إلى الحذاء وتُسقط المذياع، بينما تُظهر الخلايا العريضة في التقسيمين أ وب الاثنين معًا. وإذا لم تتّسع خلية لمنطقة آمنة، ظهرت الصورة بأشرطة فارغة ونبّه التنضيد (comicPanelLetterbox). تحدّد نقاط الارتكاز فم كل شخصية ووجهها بالنسب نفسها، فتصل ذيول الفقاعات إلى الشخصية المتكلمة في أي قصّ.
#3 · ضع إطارًا فوق إطار
في التقسيم ج أربع خلايا لخمسة إطارات. يدخل القط بالسمة inset="50 50 46 46": إطار عرضه وارتفاعه ٤٦٪ من الإطار الذي قبله، إطار مايا، موضوع عند ٥٠٪، ٥٠٪ منه. الإطار الداخلي لا يشغل خلية، فتبقى الإطارات التالية في أماكنها، ويُقرأ مباشرة بعد الإطار الذي يغطيه.
#4 · اكتب حوارات عشر طبعات على تصميم واحد
// The lettering and sound-effect faces of each edition: the engine's defaults, but for Chinese
// two ZCOOL faces drawn for cartoons instead of Noto Sans SC. content.<lang>.md holds the words
// of each edition under the same speaker ids; Japanese balloons are set vertically, and the
// Japanese and Arabic editions, read right to left, mirror the order of the panels in every row.
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'],
});
التقسيم والصور والقصّ ونقاط الارتكاز واحدة في كل اللغات؛ والملف content.<lang>.md لا يتضمّن إلا الكلمات، بمعرّفات الشخصيات نفسها (maya، tomas). تكتب الطبعة اليابانية فقاعاتها عموديًا، ثمانية أحرف في العمود، وتحذف «。» في آخر الجملة؛ وتُقرأ الطبعتان اليابانية والعربية من اليمين إلى اليسار، فينعكس ترتيب الإطارات في كل صف، أما الصور فلا تنعكس. حجم خط الحوار 8 pt في كل الطبعات: النص الأطول يصنع فقاعة أكبر، ولا يصغّر الحروف أبدًا (كتابة الحوار).
الوصفة كاملة
// ═══ Postext Cookbook · Nº 144 · One set of panels, three page splits ═══════════════
// https://postext.dev/en/cookbook/comic-page-splitters
// 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
//
// A layout proof for one page of a comic: the same five pictures and the same lines of
// dialogue laid out under three `split` trees. Each picture carries a safe area, so its subject
// stays in view whether its cell is wide, tall or square, and the lettering is placed again
// around the speakers' anchors on every page and in every language.
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 = 'comic-page-splitters';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: the night sea, the lighthouse red and the yellow of the captions
const palette = {
ink: '#1b2430', // panel borders, lettering and text: a blue-black
accent: '#b8322a', // the lighthouse red: the proof's labels
caption: '#f4e7bf', // caption boxes, an old-paper yellow
muted: '#5f6873', // folios and the imprint
paper: '#fdfbf6',
};
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: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];
// #endregion
// #region editions: one comic, six editions, each lettered in faces for its script
// The lettering and sound-effect faces of each edition: the engine's defaults, but for Chinese
// two ZCOOL faces drawn for cartoons instead of Noto Sans SC. content.<lang>.md holds the words
// of each edition under the same speaker ids; Japanese balloons are set vertically, and the
// Japanese and Arabic editions, read right to left, mirror the order of the panels in every row.
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: the comic: a frame, gutters, a panel border, and a page per split
// Every :::page fills the type area; its split attribute cuts it into cells and its ::panel
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
#أمِل الصف الأوسط
المقاس المكتوب 30~40 يمدّ الفاصل الأخير لتلك الخلية من ٣٠٪ عند طرف إلى ٤٠٪ عند الطرف الآخر. والخلايا المائلة تفقد زواياها المستديرة.
-:::page{split="30 / 35 [* | * | *] / *"}
+:::page{split="30 / 35 [30~40 | * | *] / *"}#اعكس الصور في الطبعات التي تُقرأ من اليمين
تحتفظ الصور باتجاهها افتراضيًا. والقصة المرسومة بلا كتابة ولا ساعات يمكن أن تتبع اتجاه القراءة.
const comics = {
+ mirrorArt: true, // pictures flip in a right-to-left edition
gutter: { horizontal: mm(4), vertical: mm(3) },أخطاء شائعة
- الخلية التي عرضها خُمس الصفحة تتّسع لنحو أربع كلمات في السطر بخط 8 pt، ووجه الحارس في التقسيم ج في وسط خليته: فقاعتاه عن العاصفة لا تتّسع لهما المساحة فوق وجهه ولا تحته. لذلك تُكتب
breakعلى أولى العبارتين هناك (tomas{break}:)، فيجوز للفقاعتين أن تعبرا الفاصل إلى إطار مايا؛ ويُبقي المحرّك الفقاعة الثانية بعد الأولى ولا يُخرجها إلى هامش الصفحة. ومن دونbreakيُصدر البناء التحذيرcomicBalloonOverflow. - المنطقة الآمنة الأضيق تتيح قصًّا نظيفًا في خلايا أكثر، لكن ما يقع خارجها قد يضيع: الحذاء في الصف الأول من التقسيم أ، والمذياع في التقسيم ج.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- نص أصلي, CC BY 4.0
- الصور
- Panel picture: Maya arrives at the lighthouse · Generated With Diffusion Models · أصلي
- Panel picture: Tomás at the radio · Generated With Diffusion Models · أصلي
- Panel picture: Maya finds the problem · Generated With Diffusion Models · أصلي
- Panel picture: Biscuit asleep on the cable · Generated With Diffusion Models · أصلي
- Panel picture: the lamp lit at night · 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
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


