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

دليل الوصفات · الفصل 10 · الإخراج والدمج

مجلد من سلسلة، والسلسلة على أوراق بطانته

المجلد الحادي عشر من سلسلة مجلدة في اثني عشر مجلدًا: رقما ردمك بجانب الشريط الرمزي، وغلاف مشترك بين المجلدات، والسلسلة كلها على أوراق البطانة.

في هذه الصفحة
المُخرَج
Canvas · PDF
المستوى
متقدم
Postext
اختُبرت مع Postext 1.92.0
تتطلب ≥ 1.92.0 · postext-pdf ≥ 1.92.0
الترخيص
حُدّثت في 23 نوفمبر 2026
الشيفرة MIT · النص CC BY 4.0

ص 1 · 27 من 29

  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 120 × 185 مم
  • عمود واحد
  • Crimson Pro 11/15.2
  • Cormorant Garamond
  • Josefin Sans
  • 29 صفحة
  • المستوى
  • Postext 1.92.0
  • أُخرجت في 110 ms
  • أسطر الشيفرة: 238

باختصار

كتاب مجلد من سلسلة من اثني عشر كتابًا، مع أوراقه المعدّة للمطبعة: الغلاف المقوّى بألوان السلسلة ورقم المجلد، وورقتا البطانة في داخله، وعليهما أغلفة الكتب الاثني عشر وعناوينها.

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

‏الزواج المخادع، الحادية عشرة من الروايات النموذجية الاثنتي عشرة لثربانتس، مجلدًا حادي عشر في سلسلة تصدر كل رواية في مجلد مقوّى. تُنضد الصفحات الست والعشرون بخط Crimson Pro بقياس 11/15.2 على صفحة 120 × 185 مم. ومنها يصنع buildCover ثلاث أوراق للمجلِّد: الغلاف المقوّى المطبوع بلون السلسلة الأحمر الداكن، بإطار ذهبي حول اللوحة ورقم المجلد في حلقة ذهبية، وورقتا البطانة الأمامية والخلفية اللتان تتقاسمان السلسلة: المجلدات من I إلى VI في أول الكتاب ومن VII إلى XII في آخره، وكل نصف لوحاتٌ على الورقة الملصقة وقائمةٌ مرقّمة على الورقة الطائرة. وبجانب الشريط الرمزي الذي يحمل ردمك المجلد يطبع الغلاف ردمك العمل الكامل.

تجيب هذه الوصفة عن

  • كيف أطبع مجلّدًا من سلسلة بردمك السلسلة وعناوينها الأخرى على أوراق البطانة؟

الجواب المختصر

script.js · الأسطر 30–58في الشيفرة الكاملة
// The collection is data of the book, beside its versions. The volume's barcode carries its
// own ISBN, and the collection's `isbn` prints as a line above the bars. `catalogue` lists
// the twelve titles with their cover pictures, and `volume` names the one this book is: the
// endpapers set the list and the pictures from it (section 4), this volume marked in both.
const collection = {
  name: t({ en: 'Exemplary Novels', es: 'Novelas ejemplares' }),
  isbn: '978-84-0000-200-8',
  catalogue: [
    work('The Little Gipsy Girl', 'La gitanilla', 'gitanilla'),
    work('The Generous Lover', 'El amante liberal', 'amante'),
    work('Rinconete and Cortadillo', 'Rinconete y Cortadillo', 'rinconete'),
    work('The Spanish-English Lady', 'La española inglesa', 'espanola'),
    work('The Licentiate Vidriera', 'El licenciado Vidriera', 'vidriera'),
    work('The Force of Blood', 'La fuerza de la sangre', 'fuerza'),
    work('The Jealous Estremaduran', 'El celoso extremeño', 'celoso'),
    work('The Illustrious Scullery-Maid', 'La ilustre fregona', 'fregona'),
    work('The Two Damsels', 'Las dos doncellas', 'doncellas'),
    work('The Lady Cornelia', 'La señora Cornelia', 'cornelia'),
    work('The Deceitful Marriage', 'El casamiento engañoso', 'casamiento'),
    work('The Dialogue of the Dogs', 'El coloquio de los perros', 'coloquio'),
  ],
};
collection.volume = collection.catalogue[VOLUME - 1].id;
const production = {
  collection,
  // A printed case with a flat spine: the case sheet and two endpapers, no jacket.
  versions: [{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Tapa dura' }),
    binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000' }],
};

المكونات

الخطوط
Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1)
الأصول
  • amante-320.jpg
  • casamiento-1000.jpg
  • casamiento-320.jpg
  • celoso-320.jpg
  • coloquio-320.jpg
  • cornelia-320.jpg
  • doncellas-320.jpg
  • espanola-320.jpg
  • fregona-320.jpg
  • fuerza-320.jpg
  • gitanilla-320.jpg
  • rinconete-320.jpg
  • vidriera-320.jpg
  • The front cover: a pale ensign leaning on his sword at the gate of the hospital of Valladolid, in oils (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 1, The Little Gipsy Girl, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 2, The Generous Lover, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 3, Rinconete and Cortadillo, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 4, The Spanish-English Lady, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 5, The Licentiate Vidriera, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 6, The Force of Blood, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 7, The Jealous Estremaduran, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 8, The Illustrious Scullery-Maid, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 9, The Two Damsels, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 10, The Lady Cornelia, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 11, The Deceitful Marriage, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)
  • The cover painting of volume 12, The Dialogue of the Dogs, on the endpapers, painted to match the front cover (Generated With Diffusion Models, أصلي)

طريقة التحضير

#1 · السلسلة من بيانات الكتاب

الشيفرة هي الجواب المختصر أعلاه. يحفظ production.collection السلسلة: اسمها وردمكها وcatalogue فيه معرّف وعنوان وصورة لكل مجلد، وvolume، معرّف المدخل الذي هو هذا الكتاب. وisbn السلسلة هو ما يطبعه Postext بجانب الشريط الرمزي: سطر أسود بقياس 6.5 نقطة فوق الأشرطة، «ردمك العمل الكامل»، بلغة الكتاب. وإذا ذكر الإصدار workIsbn خاصًا به طُبع ذاك. والرقمان كلاهما أرقام نموذجية من الكتلة 978-84-0000 لا تعود إلى أي كتاب. وتنبّه فحوص الإعداد إلى volume غير موجود في الفهرس وإلى ردمك سلسلة رقمُ تحققه خاطئ.

#2 · كسوة واحدة لكل المجلدات

script.js · الأسطر 63–80في الشيفرة الكاملة
// Every position is in mm from the top-left corner of its zone (the case's front is
// 116 × 191 mm: the 120 × 185 trim, set back 7 mm at the joint, 3 mm square round it).
const box = (id, zone, x, y, width, height, color, extra) => ({ id, kind: 'box', zone, x, y,
  width, height, color: col(color), ...extra });
const picture = (id, zone, x, y, width, height, resourceId, extra) => ({ id, kind: 'image', zone,
  x, y, width, height, resourceId, fit: 'cover', ...extra });
// `basis`: the spine drawn on; a thicker book stretches the bands and keeps the badge centred.
const spine = { basis: { width: 10, height: 191 } };
const livery = [
  box('frame', 'front', 11.2, 59.2, 93.6, 105.6, 'gold'),
  picture('art', 'front', 12, 60, 92, 104, 'cover-art'),
  picture('badge', 'front', 51.5, 169, 13, 13, 'badge', { fit: 'contain' }),
  box('head-band', 'spine', 0, 13, 10, 0.8, 'gold', spine),
  box('foot-band', 'spine', 0, 160, 10, 0.8, 'gold', spine),
  picture('spine-badge', 'spine', 1, 167, 8, 8, 'badge', { fit: 'contain', ...spine }),
  // A paper label for the barcode, whose caption is set in black.
  box('label', 'back', 53, 147, 61, 40, 'bone'),
];

تصميم الغلاف هو الكائن نفسه في كل مجلدات السلسلة، ولا يتغير إلا VOLUME واللوحة والنصوص. يوضع كل عنصر بالنسبة إلى المنطقة التي يقع فيها، فإذا كان لمجلد آخر صفحات أكثر وكعب أسمك انتقل الغلاف الأمامي مع لوحته. وعلى الكعب يسجّل basis عرض الكعب البالغ 10 مم الذي رُسمت عليه الشرائط، فإذا كان الكعب 8.3 مم أو 14 مم امتدت الشرائط إلى عرضه وبقيت الحلقة على محوره. والسطر فوق الشريط الرمزي مطبوع بالأسود، ولذلك يستقر الشريط على ملصق فاتح.

#3 · لكل ورقة بطانة تصميمها

script.js · الأسطر 84–99في الشيفرة الكاملة
// The case takes the livery; each endpaper names a design in `sheets`. At the front the
// pastedown is the left page, at the back the right one: volumes I–VI open the book,
// VII–XII close it, the pictures always on the pastedown, in the case's colour. A catalogue
// element grids the titles' pictures in its box; `stroke` outlines this volume's.
const shelf = (first, last) => ({ id: `shelf-${first}`, kind: 'catalogue', zone: 'pastedown',
  x: 26.5, y: 18, width: 67, height: 149, columns: 2, gap: 7, first, last,
  stroke: { color: col('gold'), width: 0.8 } });
const endpaper = (first, last) => ({ background: col('endpaper'),
  zones: { pastedown: col('case') }, elements: [shelf(first, last)],
  verticalAlign: { flyleaf: 'middle' } });
const cover = {
  background: col('case'),
  elements: livery,
  verticalAlign: { back: 'top' },
  sheets: { endpaperFront: endpaper(1, 6), endpaperBack: endpaper(7, 12) },
};

يعطي cover.sheets ورقةً تصميمًا يحل محل تصميم الغلاف: هنا endpaperFront وendpaperBack، لكل منهما أرضيته، والورقة الملصقة بلون الغلاف، وعنصر catalogue. العنصر صندوق في منطقة يملؤه المحرك بصور العناوين من first إلى last، في columns أعمدة بينها gap مم، وكل صورة تغطي خليتها. ويُحاط العنوان الذي معرّفه collection.volume بـstroke العنصر؛ وهو على ورقتي البطانة هاتين الإطار الذهبي حول المجلد XI. لا تصل كسوة الغلاف إلى أوراق البطانة، لأن كل ورقة لا ترسم إلا تصميمها. عند فتح الكتاب من أوله تكون الورقة الملصقة هي الصفحة اليسرى، وفي آخره اليمنى، فتبقى اللوحات دائمًا على الكرتون.

تأتي العناوين من ملف Markdown الغلاف، وهو يخدم كل الأوراق. والإطار الذي يسمّي أوراقه لا يوضع إلا عليها:

:::frame{slot="flyleaf" sheet="endpaperBack"}
:::paragraphs{style="ad-head"}
Exemplary Novels
:::
 
::catalogue{numbers="I" first=7 last=12}
:::

يُستبدل بـ::catalogue عناوين الفهرس، فقرة لكل عنوان: الموضع بنمط الترقيم الذي يحدده numbers، ثم مسافة بعرض نصف مربع (en space)، ثم العنوان. تأخذ الأسطر نمط الفقرة cover-catalogue، وسطر هذا المجلد cover-catalogue-current؛ وتعيد الشيفرة تعريف الاثنين، في الوسط بخط Crimson Pro، والحالي بالأحمر الداكن. ويسمّي إطار الغلاف الخلفي case jacket، فتتركه أوراق البطانة.

#4 · ثلاث أوراق من كتاب واحد

script.js · الأسطر 421–432في الشيفرة الكاملة
const sheet = async (kind) => {
  const built = buildCover({ config, version: 'hardcover', pages: book.pages,
    markdown: coverText, metadata: book.metadata, resources, sheet: kind });
  if (!('config' in built)) throw new Error(built.issues.map((i) => i.kind).join(', '));
  // The barcode's digits name OCR-B, which no font server has: the label face sets them.
  for (const [id, bytes] of Object.entries(built.files)) {
    await loadSvg(id, new TextDecoder().decode(bytes)
      .replace(/font-family="[^"]*"/g, 'font-family="Josefin Sans"'));
  }
  return { built, doc: await buildDocumentWithFonts(built.content, built.config, kitFonts(FONTS)) };
};
const sheets = [await sheet('cover'), await sheet('endpaperFront'), await sheet('endpaperBack')];

الاستدعاء نفسه مع sheet: 'cover' و'endpaperFront' و'endpaperBack' يصنع الغلاف وورقتي البطانة، كل منها وثيقة من صفحة واحدة بمقاسها الخاص. تُقرَّب الصفحات الست والعشرون إلى ملزمتين من 16 صفحة، أي 16 ورقة سمك كل منها 240 ميكرومترًا؛ ومع هامش نصف مليمتر يبلغ سمك كتلة الصفحات 4.3 مم، ويبلغ كعب الغلاف 8.3 مم بإضافة لوحين من الكرتون سمك كل منهما 2 مم. تُفحص كتابة الكعب على كعب الغلاف، وهو أعرض من الحد الأدنى البالغ 6 مم. يضم ملف PDF الصفحات الست والعشرين، ثم الغلاف وورقتي البطانة.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 198 · A volume of a collection, its endpapers the series ═══
// https://postext.dev/en/cookbook/collection-volume-endpapers
// Code: MIT · Text: Cervantes, tr. W. K. Kelly (public domain) · Art: diffusion models
// Fonts: Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1) · Needs postext ≥ 1.92.0
//
// Volume XI of the twelve Exemplary Novels, one novella per hardcover: the series livery on
// the case, two ISBNs by the barcode, the twelve titles of the collection on the endpapers.
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { buildCover, workIsbnCaption } from 'https://esm.sh/postext/production';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'collection-volume-endpapers';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
const palette = { ink: '#2a211c', accent: '#7a2a22', muted: '#6c6258', paper: '#fbf7ee',
  case: '#5e1c1a', gold: '#d2ae6a', bone: '#f1e8d4', endpaper: '#ece0c6' };
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' } },
];
const VOLUME = 11; // this book's place in the collection
const roman = (n) => 'I II III IV V VI VII VIII IX X XI XII'.split(' ')[n - 1];
const work = (en, es, id) => ({ id, title: t({ en, es }), resource: `cat-${id}` });

// #region answer: the volume and its collection: two ISBNs and the series' catalogue
// The collection is data of the book, beside its versions. The volume's barcode carries its
// own ISBN, and the collection's `isbn` prints as a line above the bars. `catalogue` lists
// the twelve titles with their cover pictures, and `volume` names the one this book is: the
// endpapers set the list and the pictures from it (section 4), this volume marked in both.
const collection = {
  name: t({ en: 'Exemplary Novels', es: 'Novelas ejemplares' }),
  isbn: '978-84-0000-200-8',
  catalogue: [
    work('The Little Gipsy Girl', 'La gitanilla', 'gitanilla'),
    work('The Generous Lover', 'El amante liberal', 'amante'),
    work('Rinconete and Cortadillo', 'Rinconete y Cortadillo', 'rinconete'),
    work('The Spanish-English Lady', 'La española inglesa', 'espanola'),
    work('The Licentiate Vidriera', 'El licenciado Vidriera', 'vidriera'),
    work('The Force of Blood', 'La fuerza de la sangre', 'fuerza'),
    work('The Jealous Estremaduran', 'El celoso extremeño', 'celoso'),
    work('The Illustrious Scullery-Maid', 'La ilustre fregona', 'fregona'),
    work('The Two Damsels', 'Las dos doncellas', 'doncellas'),
    work('The Lady Cornelia', 'La señora Cornelia', 'cornelia'),
    work('The Deceitful Marriage', 'El casamiento engañoso', 'casamiento'),

يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)

تنويعات

#ألبس الغلاف سترة

في التجليد المقوّى يضيف flaps سترة، وهي ورقة رابعة لها ثنيتاها. ينتقل الشريط الرمزي وردمك العمل الكامل إلى غلافها الخلفي، ومعهما نص التعريف الذي يسمّي إطاره jacket.

   versions: [{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Tapa dura' }),
-    binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000' }],
+    binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000', flaps: true }],

#انضد المجلد التالي

في المجلد الثاني عشر يبقى التصميم على حاله: يعيّن VOLUME مدخل الفهرس في collection.volume، فتتبعه الحلقة والإطار الذهبي على أوراق البطانة والعنوان المميَّز. أما Markdown الغلاف واللوحة والردمك فهي لذلك المجلد.

-const VOLUME = 11; // this book's place in the collection
+const VOLUME = 12; // this book's place in the collection

أخطاء شائعة

  • تأتي الأوراق بعد صفحات الكتاب في القائمة الملتقطة: الغلاف هو الصفحة 27، أي عدد صفحات الكتاب زائد واحد. وأي تغيير يضيف صفحة إلى الكتاب يزيحها.
  • يعدّ فحص contentInConfig في كتاب الوصفات السطر الذي يطبعه buildCover فوق الشريط الرمزي نصًا محفوظًا في تصميم. تدرجه الشيفرة في checks.contentInConfig.allow بصياغة workIsbnCaption، وهي الدالة التي يستعملها المحرك.
  • لا يرسم عنصر catalogue إلا الصور. قائمة العناوين هي ::catalogue في Markdown، فالورقة الخالية من هذا السطر تعرض اللوحات بلا أسماء تحتها.
  • تطلب أرقام الشريط الرمزي خط OCR-B، ولا يقدّمه أي خادم خطوط. حمّل الشريط الرمزي بـfont-family خطٍّ تحمّله الشيفرة أصلًا، وإلا فشل ملف PDF.

الحقوق

الوصفة
Ignacio Ferro
النص
  • The Deceitful Marriage, translated by Walter K. Kelly, from The Exemplary Novels of Cervantes (London, Bohn’s Standard Library, 1846; 1881 reprint), Project Gutenberg eBook #14420 · Miguel de Cervantes · ملك عام
  • El casamiento engañoso, from the Novelas ejemplares in the 1825 edition as transcribed on Wikisource · Miguel de Cervantes · ملك عام
الصور
  • The front cover: a pale ensign leaning on his sword at the gate of the hospital of Valladolid, in oils · Generated With Diffusion Models · أصلي
  • The cover painting of volume 1, The Little Gipsy Girl, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 2, The Generous Lover, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 3, Rinconete and Cortadillo, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 4, The Spanish-English Lady, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 5, The Licentiate Vidriera, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 6, The Force of Blood, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 7, The Jealous Estremaduran, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 8, The Illustrious Scullery-Maid, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 9, The Two Damsels, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 10, The Lady Cornelia, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 11, The Deceitful Marriage, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
  • The cover painting of volume 12, The Dialogue of the Dogs, on the endpapers, painted to match the front cover · Generated With Diffusion Models · أصلي
الخطوط
Crimson Pro (SIL OFL 1.1) · Cormorant Garamond (SIL OFL 1.1) · Josefin Sans (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
SandboxPDF