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

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

الغلاف المقوّى والغلاف الواقي وأوراق البطانة

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

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

ص 1 · 39 من 41

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

باختصار

أسطورتا بيكير نفسهما في كتاب مجلد: القماش الذي يكسو الألواح، والغلاف الورقي الذي يلفّه، والأوراق المرسومة الملصقة من الداخل. الصفحات لا تتغير، ولكل نسخة أفرخها وردمكها.

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

أسطورتا بيكير من الطبعة ذات الغلاف الورقي والألسنة، مجلّدتان مرة ثانية في كتاب مقوّى الغلاف بقياس 120 × 190 مم. تبقى الصفحات السبع والثلاثون كما هي. صار للكتاب الآن نسختان، لكل منهما تجليدها وردمكها، وتعطي النسخة المجلدة المجلِّدَ أربعة أفرخ. يكسو الغلافَ قماش أخضر داكن، والعنوان واسم المؤلف مختومان بالذهب على اللوح الأمامي وعلى الكعب. ويحمل الغلاف الواقي اللوحة ونص التعريف والرمز الشريطي واللسانين. وفي باطن اللوحين ورقتا بطانة مرسومتان: سوريا فوق نهر دويرو في المقدمة، والعين التي تدور فيها الأسطورة الثانية في المؤخرة.

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

  • كيف أصنع الغلاف المقوّى وسترته وأوراق البطانة لطبعة مجلّدة من الكتاب نفسه الذي صدر بغلاف ورقي؟

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

script.js · الأسطر 29–55في الشيفرة الكاملة
// The paperback is Nº 196's, on the printer's own profile. The hardcover takes the built-in
// flat-spine case; `flaps` on a case means a dust jacket, and `caseMaterial: 'cloth'` a case
// covered in cloth and stamped, under the jacket. Spines, boards and turn-ins come from the
// laid-out pages on the paper of `folio.paper`.
const production = {
  bindings: [{ id: 'pur-flaps', name: 'PUR perfect binding, 60 mm flaps', style: 'perfect',
    signature: 16, measures: { flapWidth: 60, bleed: 3, spineAllowance: 0.5 } }],
  versions: [
    { id: 'paperback', name: t({ en: 'Paperback', es: 'Rústica' }), binding: 'pur-flaps',
      flaps: true, isbn: '978-84-0000-196-4', isbnAddOn: '90000' },
    { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
      flaps: true, caseMaterial: 'cloth', isbn: '978-84-0000-197-1', isbnAddOn: '90000' },
  ],
};
// 100 g/m² bulky cream wove at a bulk of 2.4: each leaf is 100 × 2.4 = 240 µm thick.
const folio = { paper: { type: 'bookWove', grammage: 100, bulk: 2.4, shade: '#f7f1e3' } };
// The book's cover design (the paperback's, the jacket's): a night ground and the painting
// on the front panel, into the bleed, whatever the panel's width. `sheets` gives the
// hardcover's other sheets a design of their own: the case its cloth, each endpaper its
// painting across both leaves.
const cover = { background: col('night'), verticalAlign: { back: 'middle' },
  image: { resourceId: 'moncayo', area: 'front', focus: { x: 0.5, y: 0.4 } },
  sheets: {
    case: { background: col('cloth') },
    endpaperFront: { image: { resourceId: 'soria' } },
    endpaperBack: { image: { resourceId: 'fuente' } },
  } };

المكونات

الخطوط
Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1)
الأصول
  • fuente-1300.jpg
  • moncayo-1100.jpg
  • soria-1300.jpg
  • The dust jacket: a ruined chapel under the Moncayo on All Souls’ Night, in oils (Generated With Diffusion Models, أصلي)
  • The front endpaper: Soria above the Duero at dusk, with the Mountain of the Spirits (Generated With Diffusion Models, أصلي)
  • The back endpaper: a spring among poplars on the slopes of the Moncayo by moonlight (Generated With Diffusion Models, أصلي)

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

#1 · كتلة صفحات واحدة ونسختان

الشيفرة هي الجواب المختصر أعلاه. تقرأ النسختان folio.paper نفسه والصفحات المنضدة نفسها: 37 صفحة تُقرَّب صعودًا إلى ثلاث ملازم من 16 صفحة، أي 24 ورقة سمك كل منها 240 ميكرومترًا. تضيف الطبعة الورقية هامش الغراء فيصير كعبها 6.3 مم. وتضيف النسخة المجلدة فوق ذلك لوحيها بسمك 2 مم لكل منهما، فيبلغ كعبها 10.3 مم. لكل نسخة ردمكها، وكلاهما رقم للتمثيل من كتلة ناشر لا يخص أي كتاب. الكعب مسطّح لأن كتلة يقل سمكها عن 6 مم أرقّ من أن تُقوَّس؛ وcase-round يضيف 3 مم ويقوّسه. والغلاف من القماش (cloth) لأن الغلاف الواقي يحمل اللوحة والنصوص والرمز الشريطي، فيكفي تحته عنوان مختوم.

#2 · الغلاف المقوّى: الثنية والمفاصل والحواف البارزة

script.js · الأسطر 545–562في الشيفرة الكاملة
// One call per sheet, with the same config and the same cover text: each sheet takes its
// design from `cover.sheets` (the jacket, the book's) and the frames meant for it. The
// barcode goes on the jacket alone, the sheet a till scans.
const built = {};
for (const sheet of ['cover', 'jacket', 'endpaperFront', 'endpaperBack']) {
  const made = buildCover({ config, sheet, pages: book.pages, version: 'hardcover',
    markdown: coverText, metadata: book.metadata, resources });
  if (!('config' in made)) throw new Error(made.issues.map((i) => i.kind).join(', '));
  // The barcode's digits name OCR-B, which no font server has: set in the label face.
  for (const [id, bytes] of Object.entries(made.files)) {
    await loadSvg(id, new TextDecoder().decode(bytes)
      .replace(/font-family="[^"]*"/g, 'font-family="Josefin Sans"'));
  }
  built[sheet] = made;
}
const sheetDoc = (b) => buildDocumentWithFonts(b.content, b.config, kitFonts(FONTS));
const caseDoc = await sheetDoc(built.cover);
const jacketDoc = await sheetDoc(built.jacket);

يُقصّ غلاف الكتاب الورقي على قياس الكتاب وتنثني ألسنته عند الحافة الأمامية. أما غلاف الكتاب المجلد فكسوة تلفّ لوحين من الكرتون. يُقصّ كل لوح أضيق من الصفحة بـ7 مم من جهة الكعب، ويبرز عن الصفحات 3 مم في الرأس والذيل والحافة الأمامية، فيصير قياسه 116 × 196 مم. وبين كل لوح والكعب مفصل عرضه 7 مم ينثني فيه الغلاف. ومن حول الكل ثنية عرضها 15 مم تنقلب على حواف اللوحين، ولهذا تمتد أرضية القماش إلى فرخ قياسه 286.3 × 226 مم.

تُصنع الأفرخ كلها من config واحد ونص غلاف واحد. يأخذ الغلاف تصميمه من cover.sheets.case، وهو أرضية قماش لا غير، ويأخذ أسطره من الإطارات الموسومة sheet="case": العنوان والعنوان الفرعي واسم المؤلف على اللوح الأمامي والكعب، بأنماط case- هي أنماط الغلاف الواقي بالذهبي، وإطار فارغ على اللوح الخلفي يُبقي القماش خاليًا من نص التعريف. ولا يُطبع الرمز الشريطي إلا على الغلاف الواقي، وهو ما يُمسح عند الدفع.

#3 · الغلاف الواقي يعيد تصميم الغلاف ونصه

script.js · الأسطر 59–81في الشيفرة الكاملة
const style = (id, fontFamily, size, lead, color, extra) => ({ id, fontFamily, fontSize: pt(size),
  lineHeight: pt(lead), color, italicColor: color, firstLineIndent: mm(0), textAlign: 'left',
  hyphenation: false, ...extra });
const caps = (tracking) => ({ fontWeight: 600, textTransform: 'uppercase',
  letterSpacing: pt(tracking) });
const coverStyles = [
  style('cover-title', 'Cormorant Garamond', 40, 40, col('bone'), { fontWeight: 600,
    textAlign: 'center', marginTop: mm(12) }),
  style('cover-subtitle', 'Cormorant Garamond', 15, 19, col('bone'), { italic: true,
    textAlign: 'center' }),
  style('cover-author', 'Josefin Sans', 8.5, 11, col('gold'), { ...caps(1.8),
    textAlign: 'center', marginTop: pt(16) }),
  style('cover-spine', 'Josefin Sans', 7.5, 9, col('bone'), { ...caps(1.2), textAlign: 'center' }),
  style('cover-blurb', 'Crimson Pro', 10.5, 14.5, col('bone'), { marginBottom: pt(7) }),
  style('cover-note', 'Crimson Pro', 10.5, 14.5, col('gold'), { italic: true }),
  style('flap-head', 'Josefin Sans', 7.5, 10, col('gold'), caps(1.4)),
  style('flap-text', 'Crimson Pro', 9.6, 13.2, col('bone'), { marginTop: pt(5) }),
];
// The case's frames (`sheet="case"` in the cover text) set the jacket's lines in gold, the
// colour the cloth is stamped in.
const stamped = coverStyles.filter((s) => /title|subtitle|author|spine/.test(s.id))
  .map((s) => ({ ...s, id: s.id.replace('cover-', 'case-'), color: col('gold'),
    italicColor: col('gold') }));

ليس للغلاف الواقي مدخل في cover.sheets، فيأخذ cover الكتاب والإطارات التي لا تحمل sheet، بأنماط الفقرات وMarkdown الغلاف الذي تستعمله الطبعة الورقية؛ وتُملأ واجهته الأمامية وكعبه من البيانات الوصفية لأن إطارات الغلاف تُترك هناك. لوحاته أعرض: كل منها يغطي لوحًا والمفصل و3 مم زيادة لينثني على الحافة، 126 مم في المجموع. ويصير عرض اللسانين 80 مم، أي ثلثي عرض الصفحة، وهو القياس الافتراضي للغلاف الواقي. تملأ اللوحة المرسومة اللوحة الأمامية حتى خط الطي، ويقع الرمز الشريطي على اللوحة الخلفية حيث يقرؤه البائع.

#4 · ورقتا البطانة في مستند واحد

script.js · الأسطر 566–572في الشيفرة الكاملة
// Both endpapers are the size of two pages: one document holds them, a page each, the
// back's template renamed so the two templates do not share an id.
const [ef, eb] = [built.endpaperFront, built.endpaperBack];
const back = { ...eb.config.pageTemplates.at(-1), id: 'endpaper-back' };
const endpapers = await buildDocumentWithFonts({ ...ef.content, markdown: `${ef.content.markdown}`
  + `\n\n${eb.content.markdown.replace('postext-cover', back.id)}` },
{ ...ef.config, pageTemplates: [...ef.config.pageTemplates, back] }, kitFonts(FONTS));

عرض البطانة صفحتان: نصف يُلصق على اللوح، ونصف حرّ يُقلَّب كأنه صفحة. في البطانة الأمامية يقع النصف الملصق على اليسار، وفي الخلفية على اليمين. قياس كل فرخ 246 × 196 مم، بنزف 3 مم في الرأس والذيل والحافتين الخارجيتين، ولا نزف عند خط الطي، حيث يثبّته بالكتلة شريط غراء عرضه 5 مم. وتترك اللوحتان المنتصف هادئًا لأن خط الطي يمرّ فيه. للفرخين قياس واحد، فيجمعهما مستند واحد، كل فرخ في صفحة. كل لوحة مرسومة هي تصميم بطانتها في cover.sheets، ممدودًا على الورقتين.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 197 · A hardcover's case, dust jacket and endpapers ═══
// https://postext.dev/en/cookbook/hardcover-jacket-and-endpapers
// Code: MIT · Text: Bécquer, tr. C. F. & K. L. Bates (public domain) · Art: diffusion models
// Fonts: Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1) · Needs postext ≥ 1.92.0
//
// The pages of Nº 196 bound two ways: the paperback with flaps, and a cloth hardcover in a
// dust jacket with painted endpapers. Each version has its binding and its ISBN; buildCover
// makes each sheet of the hardcover from the same laid-out pages.
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { buildCover } 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 = 'hardcover-jacket-and-endpapers';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// The last four colours are the covers': the jacket's night, gold and bone, the case's cloth.
const palette = { ink: '#25221e', accent: '#86472a', muted: '#6b645a', paper: '#fbf7ee',
  night: '#16242a', gold: '#c99b4e', bone: '#eee5d1', cloth: '#22362f' };
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' } },
];

// #region answer: two versions over the same pages, each with its binding and its ISBN
// The paperback is Nº 196's, on the printer's own profile. The hardcover takes the built-in
// flat-spine case; `flaps` on a case means a dust jacket, and `caseMaterial: 'cloth'` a case
// covered in cloth and stamped, under the jacket. Spines, boards and turn-ins come from the
// laid-out pages on the paper of `folio.paper`.
const production = {
  bindings: [{ id: 'pur-flaps', name: 'PUR perfect binding, 60 mm flaps', style: 'perfect',
    signature: 16, measures: { flapWidth: 60, bleed: 3, spineAllowance: 0.5 } }],
  versions: [
    { id: 'paperback', name: t({ en: 'Paperback', es: 'Rústica' }), binding: 'pur-flaps',
      flaps: true, isbn: '978-84-0000-196-4', isbnAddOn: '90000' },
    { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
      flaps: true, caseMaterial: 'cloth', isbn: '978-84-0000-197-1', isbnAddOn: '90000' },
  ],
};
// 100 g/m² bulky cream wove at a bulk of 2.4: each leaf is 100 × 2.4 = 240 µm thick.
const folio = { paper: { type: 'bookWove', grammage: 100, bulk: 2.4, shade: '#f7f1e3' } };
// The book's cover design (the paperback's, the jacket's): a night ground and the painting
// on the front panel, into the bleed, whatever the panel's width. `sheets` gives the
// hardcover's other sheets a design of their own: the case its cloth, each endpaper its
// painting across both leaves.

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

تنويعات

#اطبع الغلاف بدل كسوته بالقماش

احذف case من cover.sheets فيأخذ الغلاف تصميم الكتاب: أرضية الليل واللوحة على اللوح الأمامي. وتبقى إطاراته الخاصة تضع العنوان بالذهبي.

   sheets: {
-    case: { background: col('cloth') },
     endpaperFront: { image: { resourceId: 'soria' } },

#قوّس الكعب

في كتاب أسمك يضيف case-round ثلاثة مليمترات إلى كعب الغلاف، ويتسع كعب الغلاف الواقي معه.

-    { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
+    { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-round',

أخطاء شائعة

  • تأتي الأفرخ بعد صفحات الكتاب في القائمة الملتقطة: الغلاف في 38، والغلاف الواقي في 39، والبطانتان في 40 و41. إذا زادت صفحة في الكتاب تحركت كل الأرقام.
  • في الكتاب المجلد يشمل sheet="cover" الغلاف كما يشمل غلاف الكتاب الورقي، أما sheet="case" فلا يشمل إلا الغلاف. والإطار الخاص بفرخ يحل محل الإطار المشترك لتلك المنطقة على ذلك الفرخ وحده، والفارغ منه يتركها خالية.

الحقوق

الوصفة
Ignacio Ferro
النص
  • The Spirits’ Mountain and The Emerald Eyes, translated by Cornelia Frances Bates and Katharine Lee Bates, from Romantic Legends of Spain (1909), Project Gutenberg eBook #50044 · Gustavo Adolfo Bécquer · ملك عام
  • El monte de las ánimas and Los ojos verdes, from the Obras (Madrid, Fernando Fe, 1885) as transcribed on Wikisource, accents modernised · Gustavo Adolfo Bécquer · ملك عام
الصور
  • The dust jacket: a ruined chapel under the Moncayo on All Souls’ Night, in oils · Generated With Diffusion Models · أصلي
  • The front endpaper: Soria above the Duero at dusk, with the Mountain of the Spirits · Generated With Diffusion Models · أصلي
  • The back endpaper: a spring among poplars on the slopes of the Moncayo by moonlight · 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