باختصار
الفصل الأول من رواية يونانية صدرت سنة 1914، منضدًا ككتاب جيب صغير. تُقسم الكلمات في آخر السطر كما تعلّم قواعد المدرسة اليونانية، وتأتي العناوين الجارية بحروف كبيرة لا تحمل في اليونانية علامات نبر.
ما الذي ستنضده
الفصل الأول من رواية Η τιμή και το χρήμα («الشرف والمال»، 1914) لكونستانتينوس ثيوتوكيس، مأخوذًا من ويكي مصدر اليونانية، في كتاب مقاسه 13,5 × 20,5 سم. تسبقه صفحة عنوان وملاحظة عن النص؛ ويبدأ الفصل في صفحة فردية تحت رقمه Αʹ بخط GFS Didot، منخفضًا عشرة أسطر. النص بخط Literata قياس 9,7 على 14,2 نقطة، 31 سطرًا في الصفحة، مضبوط الطرفين ومقطّع بأنماط اليونانية أحادية النبر. تحمل العناوين الجارية اسم المؤلف في الصفحات الزوجية والعنوان في الفردية، بحروف كبيرة متباعدة تفقد علامة نبرها كما تقتضي الحروف اليونانية الكبيرة. تتبع الملاحظة والحرد لغة الطبعة؛ وتبقى الرواية يونانية في الطبعات الثلاث.
تجيب هذه الوصفة عن
- كيف أحصل على ضبط أسطر وتقسيم كلمات جيدين لنص إسباني أو فرنسي أو ألماني؟
- كيف أضبط الترويسات: عنوان الكتاب في الصفحة اليسرى، وعنوان الفصل في اليمنى، ورقم الصفحة في الجانب الخارجي؟
- كيف أكتب شرطات الحوار، والسنوات في بداية الفقرة، والأسعار، والرموز الحرفية من دون أن يسيء Markdown قراءتها؟
الجواب المختصر
// locale 'el' picks the monotonic patterns, which keep the digraphs and the diphthongs
// whole (μπρά-τσα, ευ-τυ-χί-α) and divide between two consonants the way a Greek school
// grammar does (κάρ-βου-να, αν-θρώ-πους). The same tag gives the Greek labels and tags the
// PDF as Greek. The defaults justify, hyphenate in config().locale and break by Knuth–Plass.
const LOCALE = 'el';
const bodyText = { // config().bodyText
fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
firstLineIndent: em(1.2), indentAfterHeading: false,
// Two letters at least on either side of a break (ξα-νά, not ξ-ανά) and no page that ends
// on a divided word. Greek words run long: spaces from 0.8× to 1.6× of the face's own,
// then up to 12‰ of tracking, and a last line under about eleven letters is a runt.
hyphenation: { leftMin: 2, rightMin: 2 }, hyphenateAcrossColumns: false,
maxWordSpacing: 1.6, minWordSpacing: 0.8, maxJustifyTracking: 12, runtMinCharacters: 22,
};
المكونات
- الميزات
- تقسيم الكلمات ولغة المستندالتقسيم الأمثل للأسطر (Knuth–Plass)الترويسات وأرقام الصفحاتخط المتنالمسافات البادئة والمحاذاة والتباعد بين الفقراتالأسطر الأرامل والأسطر اليتيمة والكلمات المعزولةصفحات افتتاح مصمَّمةأنماط العناوينسمات العنوانالنصوص والخطوط والمربعات في تصاميم الصفحةالترويسات بحسب دور الصفحةهوامش متناظرةلون الورقأنماط الفقراتالبيانات الوصفية للمستندلوحة ألوان دلاليةالتصدير إلى PDFالخطوط المضمَّنة في PDF
- تستخدم أيضًا
- ترويسات لكل قسم
- الخطوط
- Literata, GFS Didot (SIL OFL 1.1)
- الأصول
- لا شيء: كل صورة مرسومة بالشيفرة
طريقة التحضير
#1 · سمِّ اللغة: el
الشيفرة هي الجواب المختصر أعلاه. يختار locale: 'el' أنماط اليونانية أحادية النبر (التقطيع). تُبقي الثنائيات μπ وντ وγκ وτσ وτζ والإدغامات الصوتية كاملة، وتقسم بين ساكنين كما تفعل قواعد المدرسة اليونانية: في الصفحة 3 تُقسم εση-κώθηκε وμεσο-φόρι. يمنع leftMin وrightMin بقيمة 2 بقاء حرف واحد على أي جانب من القسمة، ويمنع hyphenateAcrossColumns: false أن تنتهي صفحة بكلمة مقسومة. الكلمات اليونانية طويلة؛ فمسافات بين 0,8 و1,6 من مسافة الخط نفسه، ثم تتبع حتى 12 ‰، تسوّي الأسطر.
#2 · عناوين جارية بالحروف الكبيرة
// textTransform 'uppercase' in a Greek document writes ΚΩΝΣΤΑΝΤΙΝΟΣ ΘΕΟΤΟΚΗΣ for
// Κωνσταντίνος Θεοτόκης: Greek capitals carry no accent, and the engine removes the tonos
// (and keeps a dialytika, ΑΫΠΝΙΑ) as it sets the letters. The Markdown keeps the accents,
// so search and the PDF's text read the words as written.
const caps = (size, tracking, color = 'muted') => ({ fontFamily: TEXT, fontSize: pt(size),
fontWeight: 500, letterSpacing: pt(tracking), textTransform: 'uppercase', color: col(color) });
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
const head = (id, content, parity, edge, x, y = 11.5, pages = 'body') => ({
kind: 'text', id, content, parity, pages, ...caps(7.5, 1.4), placement: at('page', edge, x, y),
});
const folio = { fontWeight: 400, letterSpacing: pt(0), color: col('ink') }; // digits: no case
const header = { elements: [
{ ...head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER), ...folio },
head('verso-author', '{author}', 'even', 'top', -SHIFT),
head('recto-title', '{title}', 'odd', 'top', SHIFT),
{ ...head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER), ...folio },
] };
const drop = (parity, x) => ({ ...head(`drop-${parity}`, '{pageNumber}', parity, 'bottom', x,
-11, 'opener'), ...folio });
const footer = { elements: [drop('odd', SHIFT), drop('even', -SHIFT)] };
في وثيقة يونانية يكتب textTransform: 'uppercase' ΚΩΝΣΤΑΝΤΙΝΟΣ ΘΕΟΤΟΚΗΣ بدل Κωνσταντίνος Θεοτόκης: الحروف اليونانية الكبيرة لا تأخذ tonos، فيحذفه المحرك وهو ينضد الحروف، وتبقى علامة الفصل (ΑΫΠΝΙΑ). يحتفظ Markdown ونص ملف PDF بالكلمات منبورة، فيجدها البحث. أرقام الصفحات لا كبير لها ولا صغير، وتبقى بوزن 400.
#3 · رقم الفصل بخط Didot
// # Α΄ {style="chapter"}: the numeral is the heading's text, a capital and the Greek numeral
// sign ʹ (U+0374), as Greek books number their chapters.
const chapter = { id: 'chapter', breakBefore: { enabled: true, parity: 'odd' },
marginBottom: pt(0), // the opener's own height already ends on a line
advancedDesign: { enabled: true, minHeight: pt(10 * LEAD), slot: { elements: [
text('book', '{title}', TEXT, 8, at('container', 'top', 0, 2 * LINE),
caps(8, 2.2, 'muted')),
text('numeral', '{titleText}', DISPLAY, 30, at('container', 'top', 0, 3.6 * LINE),
{ color: col('accent'), lineHeight: 1 }),
rule('rule', 6.4 * LINE, 10),
] } },
};
العنوان # Αʹ {style="chapter"} هو الرقم نفسه: حرف كبير وعلامة العدد ʹ، كما ترقّم الكتب اليونانية فصولها. يضعه التصميم بقياس 30 نقطة بخط GFS Didot تحت عنوان الكتاب، مع خط قصير، ويُنزل minHeight النص عشرة أسطر. يفتح breakBefore مع parity: 'odd' الفصل في صفحة فردية؛ ونمط العنوان يحدد بنفسه جهة الانتقال.
الوصفة كاملة
// ═══ Postext Cookbook · Nº 201 · A Greek novel page, hyphenated in monotonic Greek ═══════
// https://postext.dev/en/cookbook/monotonic-greek-novel
// Code: MIT · Text: K. Theotokis, Η τιμή και το χρήμα, 1914 (PD, el.wikisource) · Pictures: none
// Fonts: Literata, GFS Didot (SIL OFL 1.1) · Needs postext ≥ 1.99.1
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'el')
const RECIPE = 'monotonic-greek-novel';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text on an ivory paper and one blue-grey accent, as the Athens literary presses
// set their novels between the wars.
const palette = {
ink: '#1f1d1b', // text
accent: '#2f4f6b', // chapter numeral, rules, the title on the title page
muted: '#6a645c', // running heads, the note on the text, the colophon
paper: '#fbf8f1', // an ivory book paper
};
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 [TEXT, DISPLAY] = ['Literata', 'GFS Didot']; // a text face with Greek; a Greek Didot
const [BODY, LEAD] = [9.7, 14.2]; // pt
const LINE = (LEAD * 25.4) / 72; // mm: one line, 5.01
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
// Hung under another element, centred on it.
const under = (id, y) => ({ anchor: { to: id, edge: 'below', at: 'center' },
offset: { y: mm(y) } });
const text = (id, content, fontFamily, size, placement, extra = {}) => ({ kind: 'text', id,
content, fontFamily, fontSize: pt(size), color: col('ink'), align: 'center',
overflow: 'wrap', placement, ...extra });
const rule = (id, y, width) => ({ kind: 'rule', id, direction: 'horizontal', thickness: pt(0.5),
color: col('accent'),
placement: { ...at('container', 'top', 0, y), size: { width: mm(width) } } });
// #region page: a 13.5 × 20.5 cm novel; the text block holds 31 whole lines
const TRIM = { width: 135, height: 205 }; // mm
const [TOP, INNER, OUTER, LINES] = [20, 18, 21, 31];
const page = {
width: mm(TRIM.width), height: mm(TRIM.height), dpi: 150, backgroundColor: col('paper'),
margins: { top: mm(TOP), bottom: mm(TRIM.height - TOP - LINES * LINE),
left: mm(INNER), right: mm(OUTER), mirror: true }, // left is the inner margin on a recto
};
// 96 mm of measure: about 60 characters of Literata, nine or ten Greek words.
// #endregion
يعمل ملف script.js المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
أخطاء شائعة
خطأ شائع
يرث نمط العنوان فاصل الصفحة من مستواه
يأخذ مُدخل headingStyles كل حقل يتركه من مستوى عنوانه، بما فيه breakBefore. فصفحة المحتويات أو صفحة بيانات النشر المنسّقة على H1 بعد :::pagebreak ترث الزوجية 'odd' وتقع بعد صفحة فارغة. أعطِ هذا النمط breakBefore: { enabled: false }. أنماط العناوين →
- الحرف الكبير في أول كلمة داخل النص الجاري يحتفظ بعلامة نبره على يساره (Ό,τι، Ή κάνεις). لا يحذف النبر إلا
textTransform: 'uppercase'؛ ويجب أن يحمل Markdown النبرات دائمًا. - ليس في GFS Didot الزخرفة ❦ ولا خط مائل. فالزخرفة أو التوكيد بهذا الخط يقعان على خط آخر أو على قائم مُمال؛ وتستعمل هذه الوصفة Didot للعنوان والرقم فقط.
- الحوارات القصيرة في سطر عرضه 96 مم تترك للضبط خيارات قليلة. يحصي الالتقاط 3 أسطر من 97 تتجاوز 1,6 من المسافة العادية، أسوؤها في الصفحة 4؛ ويقلل العدد سطر أعرض أو قياس أصغر.
الحقوق
- الوصفة
- Ignacio Ferro
- النص
- Η τιμή και το χρήμα (1914), chapter I, complete, from the monotonic transcription of el.wikisource (revision 101144), with one misprint corrected, one opening guillemet restored, elision marks as ’ and each line of dialogue a paragraph · Konstantinos Theotokis · ملك عام
- The note on the text and the colophon · Postext Cookbook · أصلي
- الخطوط
- Literata (SIL OFL 1.1) · GFS Didot (SIL OFL 1.1)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


