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

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

نثر تراثي مشكول كله، بالأقواس القرآنية

مقامة على كل حرف منها حركته، منضّدة بتباعد أسطر ضعف حجم الخط، فلا تلتقي حركات سطر بحركات السطر الذي يليه.

في هذه الصفحة
المُخرَج
Canvas
المستوى
أساسي
Postext
اختُبرت مع Postext 1.65.0
تتطلب ≥ 1.28.0
الترخيص
حُدّثت في 11 أكتوبر 2026
الشيفرة MIT · النص MIT

ص ٢–٣ · 2–3 من 4

  • نموذج باللغة الإنجليزية: لا توجد طبعة عربية بعد
  • مقاس القص 140 × 210 مم
  • عمود واحد
  • Amiri 14/28
  • Aref Ruqaa
  • 4 صفحات
  • المستوى
  • Postext 1.57.1
  • أُخرجت في 81 ms
  • أسطر الشيفرة: 104

باختصار

قصة عربية قديمة مطبوعة بكل حركاتها الصغيرة فوق الحروف وتحتها. تتباعد الأسطر بما يكفي كي لا تصطدم حركات سطر بالسطر الذي تحته.

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

أربع صفحات من كتاب عربي تراثي على كل حرف فيه حركته: المقامة المارستانية لبديع الزمان الهمذاني، وفيها مجنون في مارستان البصرة يُفحم متكلّمًا ثم يعرّف بنفسه شعرًا. النص المشكول كله يرصّ الفتحة والشدة فوق الحروف والكسرة تحتها، والحركات تسكن المسافة بين الأسطر. لذلك تُنضَّد الصفحة بخط Amiri بحجم 14 pt على 28 pt، أي ضعف الحجم، ولا شيء غير ذلك: تباعد الأسطر هو التصميم. النص مضبوط بالكشيدة، يبدأ بإزاحة 1.5 em على اليمين، ويضع آياته القرآنية الثلاث بين القوسين المزخرفين ﴿ ﴾ كما في المصحف المطبوع. ولا يتغير مع الطبعة إلا سطر العنوان اللاتيني والتعليق على النص.

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

  • كم يحتاج النص العربي المشكول كاملًا من تباعد الأسطر؟

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

script.js · الأسطر 28–45في الشيفرة الكاملة
// Every letter of this maqāma carries its vowel: fatḥa and shadda over the letters, kasra
// and kasratān under them, often two marks on one letter. The marks sit in the leading,
// which never grows for them, so the leading is chosen for the most vocalised line of the
// book. Unvocalised prose sets well at 1.6 × the size; fully vocalised text needs
// 1.9–2.1 ×: here 14 pt on 28 pt, 2 ×, so a kasra hanging under one line clears a shadda
// standing on the line below. Any closer and the build reports the paragraph
// (arabicMarksExceedLeading) with the leading it would need.
const SIZE = 14; // pt
const LEAD = 2 * SIZE; // pt: 28
const bodyText = {
  fontFamily: NASKH, fontSize: pt(SIZE), lineHeight: pt(LEAD), color: col('ink'),
  boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
  // Justified with kashidas, the default in an Arabic book, written out to say so:
  // a line widens at its joins as well as at its spaces.
  textAlign: 'justify', kashida: 'auto', kashidaPatterns: 'naskh',
  firstLineIndent: em(1.5), indentAfterHeading: false, // on the start side, the right
  optimalLineBreaking: true, avoidWidows: true, avoidOrphans: true,
};

المكونات

الخطوط
Amiri, Aref Ruqaa (SIL OFL 1.1)
الأصول
لا شيء: كل صورة مرسومة بالشيفرة

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

#1 · تباعد أسطر ضعف الحجم

الشيفرة هي الجواب المختصر أعلاه. لا يزيد تباعد الأسطر أبدًا ليفسح للحركات: الكسرة تحت سطر والشدة فوق السطر التالي تتقاسمان الفراغ نفسه، فيُختار الفراغ على قدر أكثر أسطر الكتاب تشكيلًا (الحركات). في هذا النص يترك تباعد 1.6 مرة من الحجم ست فقرات تصطدم حركاتها، ويترك 1.9 فقرة واحدة؛ وعند الضعف لا تصطدم أي منها. والبناء يخبرك: إذا اصطدم سطران أصدر التحذير arabicMarksExceedLeading للفقرة، مع التباعد الذي تحتاجه (النص العربي).

الصفحة 2: حركة على كل حرف، و28 pt بين خطوط الأساس، فتمرّ كسرات السطر بعيدًا عن شدّات السطر الذي يليه.

#2 · صفحة صغيرة بسطر عريض

script.js · الأسطر 49–56في الشيفرة الكاملة
// 166 mm of text block hold seventeen lines on the 28 pt pitch (9.88 mm). The measure is
// 106 mm, about twelve words of vocalised Naskh.
const page = {
  sizePreset: 'custom', width: mm(140), height: mm(210), dpi: 150,
  backgroundColor: col('paper'),
  // mirror: left is the inner margin, at the spine (the right edge of an odd page here)
  margins: { top: mm(22), bottom: mm(22), left: mm(18), right: mm(16), mirror: true },
};

صفحة 14 × 21 سم بهامشين جانبيين 16 و18 مم تترك سطرًا عرضه 106 مم، نحو اثنتي عشرة كلمة مشكولة، وسبعة عشر سطرًا على تباعد 28 pt. تجعل الحركات الأسطر رمادية المظهر، فتبقى الصفحة بسيطة: بلا ترويسات، على ورق كريمي، بعنوان أحمر واحد. ويضع mirror: true الهامش الأعرض عند الكعب، وهو في كتاب مجلّد على اليمين الحافة اليمنى من الصفحة الفردية (ترتيب الصفحات والتجليد على اليمين).

#3 · عناوين تحافظ على الشبكة

script.js · الأسطر 60–75في الشيفرة الكاملة
// The headings carry no design: the title's line box, three lines of the grid deep, lowers
// it on the page (a top margin is dropped at the head of a page), and the levels under it
// keep to the 28 pt pitch, so the text starts on a line of the grid.
const headings = {
  fontFamily: NASKH, color: col('ink'), textAlign: 'center',
  levels: [
    // The maqāma opens on a recto.
    { level: 1, fontFamily: RUQAA, fontWeight: 700, fontSize: pt(32), lineHeight: pt(LEAD * 3),
      color: col('rubric'), marginTop: pt(0), marginBottom: pt(0),
      breakBefore: { enabled: true, parity: 'odd' } },
    { level: 2, fontWeight: 700, fontSize: pt(15), lineHeight: pt(LEAD), color: col('ink'),
      marginTop: pt(0), marginBottom: pt(0) },
    { level: 3, fontWeight: 400, fontSize: pt(10), lineHeight: pt(LEAD), color: col('muted'),
      marginTop: pt(0), marginBottom: pt(LEAD) },
  ],
};

لا تصميم للعناوين: يقع عنوان الرقعة في مستطيل سطر بعمق ثلاثة أسطر من الشبكة، ويأخذ المؤلف والسطر اللاتيني كلٌّ منهما سطرًا واحدًا من 28 pt، فيقع أول أسطر النص على الشبكة. والسطر اللاتيني {dir=ltr}، عنوان من اليسار إلى اليمين في كتاب من اليمين إلى اليسار (اتجاه المستند والكتلة والنص داخل السطر).

الوصفة كاملة

Sandbox
// ═══ Postext Cookbook · Nº 111 · Fully vocalised classical prose with Qur'anic brackets ═══
// https://postext.dev/en/cookbook/vocalised-classical-prose
// Code: MIT · Text: al-Hamadhānī, Maqāmāt, ar.wikisource (PD) · Pictures: none
// Fonts: Amiri, Aref Ruqaa (SIL OFL 1.1) · Needs postext ≥ 1.28.0
import { buildDocument, withLoadedFonts, renderPageToCanvas } from 'https://esm.sh/postext';

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

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text and a red title on a cream page, as the Beirut and Cairo editions of the
// Maqāmāt print them.
const palette = {
  ink: '#211b17', // text: a warm near-black
  rubric: '#94291d', // the accent: the title
  muted: '#6b6156', // the author's name, the Latin title line, the note on the text
  paper: '#fbf7ee', // a cream 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: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
const NASKH = 'Amiri'; // the text: a Bulaq Naskh, with its own Latin for the note
const RUQAA = 'Aref Ruqaa'; // display: the title

// #region answer: a leading of 2 × the size for text with every vowel written
// Every letter of this maqāma carries its vowel: fatḥa and shadda over the letters, kasra
// and kasratān under them, often two marks on one letter. The marks sit in the leading,
// which never grows for them, so the leading is chosen for the most vocalised line of the
// book. Unvocalised prose sets well at 1.6 × the size; fully vocalised text needs
// 1.9–2.1 ×: here 14 pt on 28 pt, 2 ×, so a kasra hanging under one line clears a shadda
// standing on the line below. Any closer and the build reports the paragraph
// (arabicMarksExceedLeading) with the leading it would need.
const SIZE = 14; // pt
const LEAD = 2 * SIZE; // pt: 28
const bodyText = {
  fontFamily: NASKH, fontSize: pt(SIZE), lineHeight: pt(LEAD), color: col('ink'),
  boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
  // Justified with kashidas, the default in an Arabic book, written out to say so:
  // a line widens at its joins as well as at its spaces.
  textAlign: 'justify', kashida: 'auto', kashidaPatterns: 'naskh',
  firstLineIndent: em(1.5), indentAfterHeading: false, // on the start side, the right
  optimalLineBreaking: true, avoidWidows: true, avoidOrphans: true,
};
// #endregion

// #region page: a 14 × 21 cm book page, seventeen lines of 28 pt

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

تنويعات

#انزع الحركات لطبعة للقراءة

يزيل tashkil: 'strip' الحركات القصيرة والشدة من الإخراج، فيمكن تنضيد النص نفسه بتباعد 1.6 مرة من الحجم؛ ويُبقي 'strip-vowels' الشدة.

-  textAlign: 'justify', kashida: 'auto', kashidaPatterns: 'naskh',
+  textAlign: 'justify', kashida: 'auto', kashidaPatterns: 'naskh', tashkil: 'strip',

#شاهد التحذير

اضبط تباعد الأسطر على 1.6 مرة من الحجم، فيُصدر البناء التحذير arabicMarksExceedLeading لست فقرات، لكل منها التباعد الذي تحتاجه، حتى 1.89 em في هذا النص.

-const LEAD = 2 * SIZE; // pt: 28
+const LEAD = 1.6 * SIZE; // pt: 22.4

أخطاء شائعة

خطأ شائع

اوسم الكتاب العربي بـ 'ar'، لا بـ LANG

نسختا الوصفة هما en وes، لكن المثال العربي عربي في كلتيهما: `locale: LANG` سيجعله من اليسار إلى اليمين، ويجلّده على اليسار، ويرقّم صفحاته 1 2 3، ويسمّي أشكاله Figure أو Figura. ومنذ postext 1.30 صار الوسم أيضًا اللغة التي يُشكَّل بها النص (يُقاس ويُرسم ويُضمَّن بها)، فتحت وسم إنجليزي أو إسباني لا يرسم خط مثل Markazi Text الأشكال العربية لعلامتَي التنصيص « » وللنقطة، وتنكسر الأسطر في مواضع أخرى. اكتب الوسم بنفسك: 'ar' (الأرقام العربية المشرقية، عُرف المشرق)، أو منطقة مثل 'ar-EG' أو 'ar-SA'، أو 'ar-MA' أو 'ar-DZ' أو 'ar-TN' لنسخة مغاربية بالأرقام الأوروبية. أما الصفحة اللاتينية التي تقتبس العربية فقط فتحتفظ بلغتها. النص من اليمين إلى اليسار →

خطأ شائع

الخطوط العربية تحتاج إلى ملفها arabic، عبر الكتلة arabic

يقدّم Fontsource الخطوط Amiri وNoto Naskh Arabic وScheherazade New في ملف لكل مجموعة فرعية، والحروف العربية في ملف arabic. لا يجلب loadFonts إلا latin (وlatin-ext)، فيأتي النص العربي على الشاشة من خط النظام ويُقاس خطأً، ويسلّم fontsourceProvider ملف latin ذاك إلى PDF، فيطبع مربعات فارغة. اذكر كتلة الأدوات arabic، واستدعِ loadArabicFonts(FONTS, markdown) بعد loadFonts، مع ذكر كل وزن تضع به الصفحاتُ نصًا عربيًا في FONTS، وأعطِ renderToPdf القيمة fontProvider: arabicPdfProvider. الخطوط العربية →

تحذير الإخراج · arabicMarksExceedLeading

الحركات تزاحم السطر التالي

السبب. فقرة من نص عربي مشكول تضع حركاتها (الفتحة، الكسرة، الشدة، التنوين…) في تباعد الأسطر، وهو لا يزيد من أجلها: فحيث تبلغ حركةٌ فوق كلمة من سطرٍ الحروفَ أو الحركاتِ النازلة تحت الكلمة التي فوقها، يتلامس السطران.

الحل. ارفع `bodyText.lineHeight` (من 1.7 إلى 1.85 em للنص المشكول جزئيًّا، ومن 1.9 إلى 2.1 em للشعر المشكول كاملًا)، أو طبّق على الفقرة نمط فقرة بتباعد أسطر أكبر، أو اضبط `bodyText.tashkil: 'strip-vowels'` لطبعة بلا حركات. التوثيق →

الحقوق

الوصفة
Ignacio Ferro
النص
  • Al-Maqāma al-Māristāniyya, fully vocalised, as ar.wikisource gives it (revision 601165), with twenty typing slips corrected, its paragraphs divided and its Qurʾān quotations set between ﴿ ﴾ · Badīʿ al-Zamān al-Hamadhānī · ملك عام
  • The note on the text, the Latin title line and the colophon · Postext Cookbook · أصلي
الخطوط
Amiri (SIL OFL 1.1) · Aref Ruqaa (SIL OFL 1.1)
الشيفرة
MIT، مثل Postext
Sandbox