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

دليل الوصفات · الفصل 2 · الحروف والنص

هوميروس باليونانية متعددة النبر مقابل ترجمته

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

في هذه الصفحة
النوع
الشعر
المُخرَج
Canvas
المستوى
متوسط
Postext
اختُبرت مع Postext 1.99.1
تتطلب ≥ 1.99.1
الترخيص
حُدّثت في 29 نوفمبر 2026
الشيفرة MIT · النص CC BY 4.0
  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 140 × 215 مم
  • عمود واحد
  • GFS Didot 10.2/15
  • 6 صفحات
  • المستوى
  • Postext 1.99.1
  • أُخرجت في 43 ms
  • أسطر الشيفرة: 150

باختصار

الأبيات الأولى من أوديسة هوميروس باليونانية القديمة، بكل نبراتها وعلامات نفسها، في الصفحات اليسرى، وترجمة شعرية إلى اليونانية الحديثة في اليمنى، كل بيت بمحاذاة البيت الذي يترجمه.

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

نص كلاسيكي صغير مقاسه 14 × 21,5 سم بخط GFS Didot، الخط متعدد النبر لجمعية الخطوط اليونانية. تفتتحه صفحة من سيرة هوميروس البيزنطية التي تنسبها موسوعة السودا إلى هسيخيوس الميليتي، ومعها شاهد قبر هوميروس في جزيرة إيوس. تليها صفحتان متقابلتان مرتين: الأبيات 1 إلى 27 من النشيد الأول من الأوديسة في الصفحات الزوجية، وترجمة أرغيريس إفتاليوتيس إلى اليونانية الحديثة بأبيات من خمسة عشر مقطعًا في الفردية، بيتًا ببيت، مع رقم كل خامس بيت في الهامش الخارجي. النصوص الثلاثة في الملك العام ومأخوذة من ويكي مصدر اليونانية. تنضد العناوين الجارية وصفحات الافتتاح العناوين بحروف كبيرة تسقط كل علامة نفس ونبر.

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

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

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

script.js · الأسطر 31–51في الشيفرة الكاملة
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());
  }));
  await Promise.all(jobs);
}

المكونات

الخطوط
GFS Didot (SIL OFL 1.1)
الأصول
لا شيء: كل صورة مرسومة بالشيفرة

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

#1 · وسم النص بـgrc وتحميل حروفه المنبورة

الشيفرة هي الجواب المختصر أعلاه. يختار locale: 'grc' الأنماط متعددة النبر (التقطيع)، وهي تقرأ علامة النفس والنبر الدائري واليوتا المكتوبة تحت وعلامة الفصل جزءًا من الحرف الذي تعلوه. تقسم الصفحة 1 Βατρα-χομυομαχία وἐπι-δειξάμενος وτυράν-νου. يقسّم Fontsource كل خط حسب نظام الكتابة، ولا يضيف loadFonts إلا ملفي latin وgreek. أما الحروف متعددة النبر المركبة مسبقًا، U+1F00–1FFF، فهي في ملف ثالث هو greek-ext، يضيفه loadGreekExtended لكل خط قبل التنضيد. استدعِه بعد loadFonts، وإلا عدّ المحرك الخط محمّلًا وتخطى ملف greek.

#2 · رقم كل خامس بيت في الهامش الخارجي

script.js · الأسطر 67–73في الشيفرة الكاملة
// Each page of verse is its own :::verse block. The Greek and the translation of a spread
// both open with {lineStart=11}, so the numbers on the two pages agree: restart 'poem'
// counts each block from its own start, and the epitaph, {numbered=false}, is not counted.
const lineNumbers = {
  enabled: true, count: 'verse', interval: 5, restart: 'poem', position: 'outer',
  gap: mm(6), fontFamily: DIDOT, fontSize: em(0.8), color: col('rubric'),
};

يرقّم count: 'verse' الأبيات وحدها، ويعدّ restart: 'poem' كل كتلة :::verse من بدايتها. كل صفحة أبيات كتلة مستقلة. يبدأ النص اليوناني والترجمة في الصفحتين المتقابلتين الثانيتين كلاهما بـ{lineStart=11}، فتتفق الأرقام على الصفحتين. يرسل position: 'outer' الأرقام إلى الهامش الأيسر للصفحة الزوجية والأيمن للفردية (أرقام الأسطر). وشاهد القبر محاط بـ{numbered=false} فلا يأخذ رقمًا.

#3 · صفحات افتتاح وعناوين جارية بالحروف الكبيرة

script.js · الأسطر 83–124في الشيفرة الكاملة
// textTransform 'uppercase' turns Ὀδύσσεια into ΟΔΥΣΣΕΙΑ and Ῥαψῳδία into ΡΑΨΩΔΙΑ: Greek
// capitals take no breathing, no accent and no iota subscript (a dialytika stays, Ϊ Ϋ).
const caps = (size, tracking, color = 'muted') => ({ fontFamily: DIDOT, fontSize: pt(size),
  letterSpacing: pt(tracking), textTransform: 'uppercase', color: col(color) });
const opener = (title) => ({ enabled: true, minHeight: pt(5 * LEAD), slot: { elements: [
  { kind: 'text', id: 'kicker', content: '{attr.kicker}', align: 'center', ...caps(8, 2, 'rubric'),
    placement: { ...at('container', 'top', 0, LINE), size: { width: 'fill' } } },
  { kind: 'text', id: 'title', content: title, align: 'center', ...caps(17, 3.5, 'ink'),
    placement: { ...at('container', 'top', 0, 2.2 * LINE), size: { width: 'fill' } } },
] } });
// # Ὀδύσσεια {style="original"} opens a verso, {style="translation"} the recto facing it;
// a style sets its own break side (gotcha: style-inherits-break).
const headingStyles = [
  { id: 'original', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'translation', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'life', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: { enabled: true, minHeight: pt(6 * LEAD), slot: { elements: [
      { kind: 'text', id: 'title', content: '{titleText}', align: 'center', ...caps(15, 3, 'ink'),
        placement: { ...at('container', 'top', 0, 1.6 * LINE), size: { width: 'fill' } } },
      { kind: 'text', id: 'source', content: '{attr.source}', align: 'center', fontFamily: DIDOT,
        fontSize: pt(10), color: col('muted'),
        placement: { ...at('container', 'top', 0, 3.2 * LINE), size: { width: 'fill' } } },
    ] } } },
  { id: 'note-page', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(LEAD),
    header: { elements: [] }, advancedDesign: { enabled: true, minHeight: pt(3 * LEAD),
      slot: { elements: [{ kind: 'text', id: 'label', content: '{titleText}', align: 'center',
        ...caps(7.5, 1.6, 'rubric'), placement: { ...at('container', 'top', 0, LINE),
          size: { width: 'fill' } } }] } } },
];
// The author and the title over the versos, the translator over the rectos; folios outside.
const head = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content, parity,
  pages: 'body', ...caps(7.5, 1.5), ...extra, placement: at('page', edge, x, 12) });
const folio = { textTransform: 'none', letterSpacing: pt(0), fontSize: pt(9), color: col('ink') };
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-head', '{author} · {title}', 'even', 'top', -SHIFT),
  head('recto-head', '{subtitle}', 'odd', 'top', SHIFT),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };

يحوّل textTransform: 'uppercase' Ὀδύσσεια إلى ΟΔΥΣΣΕΙΑ وῬαψῳδία إلى ΡΑΨΩΔΙΑ: الحروف اليونانية الكبيرة لا تأخذ علامة نفس ولا نبرًا ولا يوتا تحتية، فيحذفها المحرك عند التنضيد. يفتح النمط original النص اليوناني في صفحة زوجية، والنمط translation الترجمة في الفردية المقابلة. ويفعل :::pagebreak{parity="even"} و{parity="odd"} الشيء نفسه للصفحتين المتقابلتين الثانيتين. يبقى نص العنوان ونص PDF كما كُتبا، بكل علاماتهما.

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 202 · Homer in polytonic Greek, facing its translation ═══════
// https://postext.dev/en/cookbook/homer-polytonic-facing-translation
// Code: MIT · Texts: Homer, Hesychius, A. Eftaliotis (PD, el.wikisource) · Pictures: none
// Fonts: GFS Didot (SIL OFL 1.1) · Needs postext ≥ 1.99.1
// The opening of the Odyssey on the versos, Eftaliotis's line-for-line modern Greek on the
// rectos, both numbered every fifth line, after a page of the Byzantine Life of Homer.
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'el')
const RECIPE = 'homer-polytonic-facing-translation';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text on a warm white, and the dull red of a classical text's rubrics.
const palette = {
  ink: '#1c1a18', // the texts
  rubric: '#8c2f23', // line numbers, headings, rules
  muted: '#6b6359', // running heads, the note on the text, the colophon
  paper: '#fcfaf5',
};
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: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
const DIDOT = 'GFS Didot'; // the Greek Font Society's Didot: polytonic, with its own Latin
const [BODY, LEAD] = [10.2, 15]; // pt
const LINE = (LEAD * 25.4) / 72; // mm: one line, 5.29
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// #region answer: Ancient Greek is 'grc', with the polytonic accents written in the text
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());

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

أخطاء شائعة

خطأ شائع

يرث نمط العنوان فاصل الصفحة من مستواه

يأخذ مُدخل headingStyles كل حقل يتركه من مستوى عنوانه، بما فيه breakBefore. فصفحة المحتويات أو صفحة بيانات النشر المنسّقة على H1 بعد :::pagebreak ترث الزوجية 'odd' وتقع بعد صفحة فارغة. أعطِ هذا النمط breakBefore: { enabled: false }. أنماط العناوين →

  • من دون ملف greek-ext يقع كل حرف صوتي منبور على خط من خطوط النظام نادرًا ما يتناسب. يفحص الالتقاط كل حرف على الملفات المحمّلة (C36) ويرفض مثل هذه الصفحة.
  • لـGFS Didot وزن واحد ولا مائل لها: سيميل المُصيّر أي توكيد آليًا. لذلك تُنضد الملاحظة على النص بالقائم.
  • مزوّد خطوط PDF في الطقم لا يحمّل إلا latin وgreek، فتعرض هذه الوصفة اللوحة ولا تقدّم PDF.
  • يجب ألا يتجاوز أي بيت من الترجمة عرض السطر. فالبيت الذي ينكسر يدفع بقية الصفحة سطرًا إلى الأسفل، وتكف الصفحتان عن التقابل بيتًا ببيت؛ و103 مم بقياس 10,2 نقطة تتسع لأطول أبيات إفتاليوتيس، 59 حرفًا.

الحقوق

الوصفة
Ignacio Ferro
النص
  • Odyssey, Book I, lines 1–27, in the polytonic text of el.wikisource (revision 165777) · Homer · ملك عام
  • The modern Greek translation of the same lines, line for line, from el.wikisource (revision 166701), with one accent corrected · Argyris Eftaliotis · ملك عام
  • Life of Homer, §§ 6–7 and the epitaph, from the Suda (ed. A. Westermann, 1845), via el.wikisource (revision 152483), with four slips corrected · Hesychius of Miletus · ملك عام
  • The note on the text and the colophon · Postext Cookbook · أصلي
الخطوط
GFS Didot (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox