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

دليل الوصفات · الفصل 3 · العناوين وصفحات الافتتاح

طبعة رسائل: سطور المكان والتاريخ والتواقيع

رسائل متتابعة بلا فواصل صفحات؛ يأتي سطر المكان والتاريخ من سمات العنوان، وتضبط أنماط الفقرات التحية والتوقيع والملحوظة الختامية.

في هذه الصفحة
المُخرَج
Canvas
المستوى
متوسط
Postext
اختُبرت مع Postext 1.65.0
تتطلب ≥ 1.25.0
الترخيص
حُدّثت في 10 أكتوبر 2026
الشيفرة MIT · النص CC BY 4.0
  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 140 × 210 مم
  • عمود واحد
  • Crimson Pro 10/14.4
  • IM Fell DW Pica SC
  • IM Fell French Canon
  • 5 صفحات
  • المستوى
  • Postext 1.57.1
  • أُخرجت في 52 ms
  • أسطر الشيفرة: 161

باختصار

كتاب صغير فيه ثلاث رسائل بين ملك بروسيا وفولتير. يبيّن كيف تنضّد تاريخ كل رسالة وتحيتها وتوقيعها، وتتتابع الرسائل من غير أن تبدأ كل واحدة في صفحة جديدة.

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

خمس صفحات من Mon sort est changé، طبعة بمقاس 14 × 21 سم لثلاث رسائل بالفرنسية: الرسالتان اللتان كتبهما فريدريك الثاني إلى فولتير بعد ستة أيام واثني عشر يومًا من تولّيه عرش بروسيا في يونيو 1740، ورسالة فولتير المؤرخة في 1 أبريل 1778، قبل وفاته بشهرين. على الغلاف صورة لرسالتين مطويّتين وختم من الشمع الأحمر، مولَّدة بنماذج الانتشار، موضوعة على جلد مغربي أخضر مرسوم بالشيفرة داخل إطار مزدوج مذهَّب. في الداخل تتتابع الرسائل بلا فواصل صفحات. في رأس كل رسالة رقمها بحروف كبيرة مصغّرة حمراء واسما المتراسلَين بخط Fell المائل، وتحتهما المكان والتاريخ محاذيان إلى اليمين. للتحية سطر خاص بها، والتوقيع بالحروف الكبيرة المصغّرة يختم الرسالة عند الهامش الأيمن؛ وتلي ملحوظة فريدريك الختامية توقيعه بحجم أصغر بدرجة. وفي ترويسة كل صفحة فردية تاريخ الرسالة.

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

  • كيف أنضد نصًّا تصديريًّا أو إهداءً أو توقيعًا أو اقتباسًا بارزًا بعلامة اقتباس كبيرة؟
  • كيف أحصل على ضبط أسطر وتقسيم كلمات جيدين لنص إسباني أو فرنسي أو ألماني؟
  • كيف أضبط الترويسات: عنوان الكتاب في الصفحة اليسرى، وعنوان الفصل في اليمنى، ورقم الصفحة في الجانب الخارجي؟

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

script.js · الأسطر 43–68في الشيفرة الكاملة
// Each letter is a level-1 heading that carries its place and date as attributes:
//   # Frédéric à Voltaire {place="À Charlottembourg" date="6 juin 1740"}
// (a value holds no { or }, and one with " goes in single quotes: gotcha attr-values)
const letterHead = { enabled: true, slot: { elements: [
  // {number} prints the count as numberingTemplate '{1:I}' writes it.
  { kind: 'text', id: 'number', content: 'Lettre {number}', ...sc, fontSize: pt(9),
    letterSpacing: pt(1.8), color: col('seal'), placement: at('container', 'top-left') },
  { kind: 'text', id: 'title', content: '{titleText}', ...fell, fontSize: pt(15),
    color: col('ink'),
    placement: at('#number', 'below', 0, 1) },
  // The dateline spans the measure under the title and sets its words flush right;
  // inlineMarks reads the attribute's marks, so date="1^er^ avril 1778" raises its ordinal.
  { kind: 'text', id: 'dateline', content: '{attr.place}, le {attr.date}.', ...crimson,
    italic: true, fontSize: pt(10.4), color: col('ink'), align: 'right', inlineMarks: true,
    placement: { ...at('#title', 'below', 0, 1.5), size: { width: 'fill' } } },
] } };
// The salutation, the signature and the postscript, each a :::paragraphs{style="…"} container:
//   :::paragraphs{style="signature"}
//   Fédéric.
//   :::
const letterParts = [
  { id: 'vedette', firstLineIndent: pt(0) }, // 'Sire,' on a line of its own, flush left
  { id: 'signature', ...sc, fontSize: pt(10.5), textAlign: 'right', marginTop: pt(LEAD / 2) },
  { id: 'postscript', fontSize: pt(9), lineHeight: pt(12.6), marginTop: pt(LEAD / 2) },
];
// Hooked up below: letterHead designs the level-1 heading, letterParts joins paragraphStyles.

المكونات

الخطوط
Crimson Pro, IM Fell French Canon, IM Fell DW Pica SC (SIL OFL 1.1)
الأصول
  • letters-1160.jpg
  • The cover: two folded letters and a wax seal, a photograph (Generated With Diffusion Models, أصلي)
  • The cover’s green morocco and gilt fillet, drawn in code (Ignacio Ferro, CC BY 4.0)

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

#1 · اقرأ سطر المكان والتاريخ من العنوان

الشيفرة هي الجواب المختصر أعلاه. كل رسالة عنوان من المستوى الأول في سماته مكانها وتاريخها، ويطبعهما الرأس بالصيغة {attr.place}, le {attr.date}. (سمات العناوين). يمتد مستطيل سطر المكان والتاريخ حتى الحافة اليمنى للعمود (width: 'fill')، ويضع align: 'right' الكلمات عند تلك الحافة؛ من دونه يُوسَّط نص التصميم. التحية والتوقيع والملحوظة الختامية أنماط فقرات تُطبَّق بالتوجيه :::paragraphs{style="…"}. يأخذ التوقيع خط IM Fell DW Pica SC، وهي عائلة قُطعت أحرفها الصغيرة على هيئة حروف كبيرة مصغّرة. ومع inlineMarks: true يقرأ سطر المكان والتاريخ العلامات التي في سمته، فترفع date="1^er^ avril 1778" لاحقة الترتيب.

#2 · تابع الرسائل بلا فواصل

script.js · الأسطر 72–78في الشيفرة الكاملة
const letters = { level: 1, numberingTemplate: '{1:I}', advancedDesign: letterHead,
  // No break: left at the level's default, each letter would open on a recto.
  breakBefore: { enabled: false }, marginTop: pt(2 * LEAD),
  // The hidden heading line is measured in the heading face: italic keeps it the IM Fell cut
  // that FONTS loads. Upright, it would need the roman, which FONTS
  // leaves out; the layout would change only for a title long enough to wrap.
  italic: true };

حين يكون breakBefore معطَّلًا، تبدأ الرسالة على بُعد سطرين من الشبكة (marginTop) تحت سطر الشبكة الذي تنتهي عنده سابقتها. في الصفحة 4 تنتهي الملحوظة الختامية، المنضَّدة بتباعد أسطر 12.6 pt، بين سطرين من الشبكة، فيبقى نحو ثلاثة أسطر بيضاء فوق الرسالة الثالثة. في الصفحة 2 تمتد الرسالة الأولى حتى ذيل الصفحة، وتفتتح الرسالة الثانية الصفحة 3. ولو تُرك المستوى الأول على قيمته الافتراضية لبدأت كل رسالة في صفحة فردية (الفاصل قبل العنوان). يرقّم numberingTemplate: '{1:I}' الرسائل من I إلى III، ويطبع الرأس الرقم عبر {number}.

#3 · أرّخ الصفحة الفردية بتاريخ الرسالة

script.js · الأسطر 82–95في الشيفرة الكاملة
const HEAD_Y = 12; // mm from the top edge
const head = (id, content, parity, placement, look = {}) => ({ kind: 'text', id, content,
  parity, pages: 'body', ...sc, fontSize: pt(8.5), letterSpacing: pt(0.9), color: col('muted'),
  placement, ...look });
const folio = { ...crimson, fontSize: pt(9), letterSpacing: pt(0), color: col('ink') };
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', at('page', 'top-left', MARGIN.outer, HEAD_Y), folio),
  head('verso-names', '{author}', 'even', at('page', 'top-left', MARGIN.outer + 8, HEAD_Y)),
  // {attr.date} reads the last letter that starts on or before the page.
  head('recto-date', '{attr.date}', 'odd', at('page', 'top-right', -(MARGIN.outer + 8), HEAD_Y),
    { ...crimson, italic: true, fontSize: pt(9.5), letterSpacing: pt(0), inlineMarks: true }),
  head('recto-folio', '{pageNumber}', 'odd', at('page', 'top-right', -MARGIN.outer, HEAD_Y),
    folio),
] };

في ترويسة الصفحة تأخذ {attr.date} سمة آخر عنوان من المستوى الأول يبدأ في الصفحة أو قبلها. تطبع الصفحة 3 التاريخ 12 juin 1740، وتطبع الصفحة 5، حيث تستمر رسالة فولتير من الصفحة 4، التاريخ 1er avril 1778 ولاحقة الترتيب فيه مرفوعة (عناصر النص). تقع الترويسات على بُعد 12 mm تحت الحافة العليا للصفحة، ورقم الصفحة على الهامش الخارجي والكلمات أبعد منه نحو الداخل بمقدار 8 mm. يُبعدها pages: 'body' عن الغلاف، الذي يُحسب صفحة افتتاح لأن عنوانه يمتد على الصفحة. يُنضَّد التاريخ بخط Crimson Pro المائل الذي يُنضَّد به سطر المكان والتاريخ الذي يكرّره، والأسماء في الصفحة الزوجية بالحروف الكبيرة المصغّرة التي تُنضَّد بها أرقام الرسائل.

#4 · اجعل الغلاف عنوانًا

script.js · الأسطر 99–121في الشيفرة الكاملة
// The Markdown: # Mon sort \\ est changé {style="cover"}. The binding fills the page, so the
// design reserves all of it and the headnote starts on page 2.
const onCover = (y) => at('page', 'top', 0, y); // centred, y mm below the top edge
const LETTERS = { x: 12, y: 72, w: 116, h: 120 }; // mm: the photograph, inside the fillet
// numbered: false keeps the cover out of the count, so the first letter is I.
const cover = { id: 'cover', numbered: false,
  // span: 'page' although the book has one column. Kept in the column, the design stops at
  // the column's foot (a band of paper under the leather), and page 1 counts as a 'body' page
  // and prints the running heads.
  span: 'page', advancedDesign: { enabled: true, slot: { elements: [
    { kind: 'image', id: 'binding', resourceId: 'binding',
      placement: { ...at('bleed', 'top-left'), size: { width: 'fill', height: 'fill' } } },
    { kind: 'image', id: 'letters', resourceId: 'letters', placement: { ...at('page', 'top-left',
      LETTERS.x, LETTERS.y), size: { width: mm(LETTERS.w), height: mm(LETTERS.h) } } },
    { kind: 'text', id: 'names', content: '{author}', ...sc, fontSize: pt(9.5),
      letterSpacing: pt(2), color: col('gilt'), placement: onCover(18) },
    // \\ in the heading breaks the title here.
    { kind: 'text', id: 'title', content: '{titleText}', ...fell, fontSize: pt(50),
      lineHeight: 1, color: col('paper'), align: 'center', overflow: 'wrap',
      placement: onCover(24) },
    { kind: 'text', id: 'subtitle', content: '{subtitle}', ...crimson, italic: true,
      fontSize: pt(12), color: col('paper'), placement: onCover(62) },
  ] } } };

الغلاف هو العنوان الأول، منضَّدًا بحسب نمط العنوان cover: عنصر صورة مربوط بالنزف يرسم التجليد المرسوم، وعنصر ثانٍ يضع الصورة الفوتوغرافية على عمق 72 mm، ويأتي العنوان والأسماء والعنوان الفرعي من العنوان ومن البيانات التمهيدية (frontmatter). يُخرجه numbered: false من العدّ، فتكون رسالة فريدريك الأولى هي I. تملأ صورة التجليد الصفحة، وصفحة الافتتاح تحجز المساحة حتى أدنى عناصرها، فيأخذ الغلاف الصفحة 1 كلها ويبدأ التمهيد في الصفحة 2 من دون أي :::pagebreak.

#5 · قسّم الكلمات الفرنسية بالواصلة، وأبقِ المسافات مفتوحة

script.js · الأسطر 125–135في الشيفرة الكاملة
// Justification, hyphenation, whole-paragraph line breaking and the widow, orphan and runt
// rules are defaults; locale 'fr' (in the config) picks the French patterns.
// The letters keep the transcription's unspaced ; : ? and !; a narrow no-break space
// (U+202F) typed before each would give French spacing and never end a line.
const bodyText = { fontFamily: 'Crimson Pro', fontSize: pt(10), lineHeight: pt(LEAD),
  color: col('ink'), firstLineIndent: mm(5),
  // No :ref here: written out with the other colours, for the default-skin check.
  referenceColor: col('ink'),
  // A word space never shrinks below 75 % of the font's. At the default 60 %, the tightest
  // line on page 5 sets its spaces at 0.70 (each VDT line carries its justifiedSpaceRatio).
  minWordSpacing: 0.75 };

يقسّم locale: 'fr' الكلمات بأنماط التقسيم الفرنسية (ou-vrage في الصفحة 2، وreprésen-tation في الصفحة 4). ضبط الأسطر، وتقسيم الأسطر على مستوى الفقرة كاملة، وقواعد السطر الأرمل والسطر اليتيم والكلمة المعزولة في آخر الفقرة كلها مفعّلة افتراضيًا. يمنع minWordSpacing: 0.75 المسافة بين الكلمات من أن تنكمش إلى أقل من ثلاثة أرباع مسافة Crimson Pro؛ وبالقيمة الافتراضية 0.6 كان أضيق سطر مضبوط في الصفحة 5 سيضع مسافاته عند 0.70 من ذلك العرض. بتباعد أسطر 14.4 pt تتسع الصفحة إلى 33 سطرًا، والهامش السفلي هو ما يتبقى تحتها، أي 20.4 mm.

#6 · اربط كل لون بلوحة الألوان

script.js · الأسطر 14–29في الشيفرة الكاملة
const palette = {
  ink: '#2a2320', // the text: a warm near-black
  paper: '#f6efe2', // the page, and the lettering on the cover
  seal: '#9c2b24', // the letter numbers
  leather: '#2a4536', // the cover: a green morocco binding
  gilt: '#d0b67c', // its tooled border and the names on it
  muted: '#75695d', // the running heads
};
// col(id): a colour linked to its palette entry, in text styles and design elements alike.
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' } })),
  // The engine's default colours, the italic of the headnote among them, link to 'main-color';
  // here it is the ink, not the default blue.
  { id: 'main-color', name: 'ink (defaults)', value: { hex: palette.ink, model: 'hex' } },
];

تربط col() كل لون بمدخله في لوحة الألوان، ويسري هذا الربط في أنماط النص وفي عناصر التصميم على السواء: رؤوس الرسائل والترويسات والغلاف. يأخذ المائل في التمهيد وفي بيانات الطبع لون المائل الافتراضي المربوط بالمدخل main-color؛ وحين يُضبط ذلك المدخل على لون الحبر يُطبع بالحبر لا بأزرق المحرّك #295AA3.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 064 · Letters edition: datelines and signatures ════════════
// https://postext.dev/en/cookbook/letters-edition
// Code: MIT · Text: Frederick II and Voltaire, 1740 and 1778 (PD) · Cover photo: diffusion models
// Fonts: Crimson Pro, IM Fell French Canon, IM Fell DW Pica SC (SIL OFL) · Needs postext ≥ 1.25.0
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';

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

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: iron-gall ink on cream paper, wax red, green morocco and gilt
const palette = {
  ink: '#2a2320', // the text: a warm near-black
  paper: '#f6efe2', // the page, and the lettering on the cover
  seal: '#9c2b24', // the letter numbers
  leather: '#2a4536', // the cover: a green morocco binding
  gilt: '#d0b67c', // its tooled border and the names on it
  muted: '#75695d', // the running heads
};
// col(id): a colour linked to its palette entry, in text styles and design elements alike.
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' } })),
  // The engine's default colours, the italic of the headnote among them, link to 'main-color';
  // here it is the ink, not the default blue.
  { id: 'main-color', name: 'ink (defaults)', value: { hex: palette.ink, model: 'hex' } },
];
// #endregion
const TRIM = { width: 140, height: 210 }; // the French 14 × 21 format
const LEAD = 14.4; // pt: the body's leading, the grid every letter starts on
const LINES = 33; // lines of text on a full page
const TOP = 22; // mm: the top margin
const MARGIN = { top: TOP, inner: 17.5, outer: 14.5, // mm, mirrored
  bottom: TRIM.height - TOP - (LINES * LEAD * 25.4) / 72 }; // ends the page on line 33
const sc = { fontFamily: 'IM Fell DW Pica SC' }; // its lower case is cut as small capitals
const fell = { fontFamily: 'IM Fell French Canon', italic: true }; // the display italic
const crimson = { fontFamily: 'Crimson Pro' }; // the text face
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// #region answer: a letter head read from the heading, and styles for the letter's parts
// Each letter is a level-1 heading that carries its place and date as attributes:
//   # Frédéric à Voltaire {place="À Charlottembourg" date="6 juin 1740"}
// (a value holds no { or }, and one with " goes in single quotes: gotcha attr-values)
const letterHead = { enabled: true, slot: { elements: [
  // {number} prints the count as numberingTemplate '{1:I}' writes it.
  { kind: 'text', id: 'number', content: 'Lettre {number}', ...sc, fontSize: pt(9),

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

تنويعات

#اذكر المكان في الترويسة

يمكن للسمات نفسها أن تضع في الصفحة الفردية سطر المكان والتاريخ كاملًا، À Charlottembourg, le 12 juin 1740.

-  head('recto-date', '{attr.date}', 'odd', at('page', 'top-right', -(MARGIN.outer + 8), HEAD_Y),
+  head('recto-date', '{attr.place}, le {attr.date}', 'odd',
+    at('page', 'top-right', -(MARGIN.outer + 8), HEAD_Y),

أخطاء شائعة

خطأ شائع

قيم السمات: لا { ولا }؛ ضع القيمة التي فيها " بين علامتي اقتباس مفردتين

تنتهي قيمة السمة عند القوس المعقوف الختامي، فلا يمكن أن تحتوي { أو }. القيمة التي فيها علامة اقتباس مزدوجة توضع بين علامتي اقتباس مفردتين؛ أما علامة الدولار فلا مشكلة فيها. سمات العنوان →

  • تأخذ الصفحة الفردية تاريخ آخر رسالة تبدأ فيها أو قبلها. الصفحة التي تُنهي رسالة وتفتتح التالية يظهر فيها تاريخ الرسالة الجديدة، كما تذكر ترويسة المعجم آخر مدخل في الصفحة.
  • العنوان الذي يخلو من السمة يطبع سلسلة فارغة بلا أي تحذير: الرسالة التي ليس فيها place="…" يبدأ سطر مكانها وتاريخها بفاصلة. افحص عنوان كل رسالة.
  • تحتفظ الرسائل بعلامات ; : ? و! من غير مسافة قبلها كما في النسخة المنقولة. العُرف الفرنسي يضع قبلها مسافة ضيقة غير قابلة للكسر (U+202F)؛ فإذا كتبتها بقيت العلامة في سطر كلمتها.
  • لا يملك Crimson Pro حرفَي التعديل ᵉ (U+1D49) وʳ (U+02B3)، فإذا كُتبت 1ᵉʳ بمحارف Unicode طُبعت بخط احتياطي. اكتب 1^er^ بدلًا منها: التمهيد، وهو نص متن، ينضّدها حرفًا علويًا، وكذلك سطر المكان والتاريخ وترويسة الصفحة الفردية، لأن عنصرَي النص فيهما مضبوطان على inlineMarks: true.

الحقوق

الوصفة
Ignacio Ferro
النص
  • Frederick II’s letters to Voltaire of 6 and 12 June 1740 and Voltaire’s letter to him of 1 April 1778, in Correspondance de Voltaire avec le roi de Prusse (Paris, Librairie de la Bibliothèque nationale, 1889), one misprint corrected (ouvragés), the salutations and signatures set apart · Frédéric II · Voltaire · ملك عام
  • The headnote and the colophon · Ignacio Ferro · CC BY 4.0
الصور
  • The cover: two folded letters and a wax seal, a photograph · Generated With Diffusion Models · أصلي
  • The cover’s green morocco and gilt fillet, drawn in code · Ignacio Ferro · CC BY 4.0
الخطوط
Crimson Pro (SIL OFL 1.1) · IM Fell French Canon (SIL OFL 1.1) · IM Fell DW Pica SC (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox