منهجية التصميم Design Methodology
OpenType Features for Arabic Typography

OpenType في الخط العربي: محرك الذكاء البرمجي

OpenType Features in Arabic Typography: The Logic Behind Cursive Engines

عندما يرسم الخطاط حرفاً على الورق، يتحرك قلمه بتلقائية تحكمها عين خبيرة وقواعد راسخة؛ يعرف متى يمد السطر، ومتى يركب حرفاً فوق آخر، وكيف يوزع النقاط والحركات بدقة. في العالم الرقمي، لا تمتلك الحروف هذا الوعي الذاتي. هنا يأتي دور معيار OpenType Specification الذي طورته "مايكروسوفت" و"أدوبي"، ليكون بمثابة العقل الموجه والمنطق البرمجي الذي يحول المحارف الجامدة إلى كتابة عربية سلسة ومترابطة.

الكتابة العربية ليست مجرد حروف تجلس بجانب بعضها كما في اللاتينية، بل هي نظام اتصال حي. يعتمد هذا النظام على جدولين أساسيين داخل ملف الخط: جدول الاستبدال البرمجي (GSUB) وجدول الضبط الموضعي (GPOS). من خلالهما، نملي على المتصفح وبرامج التصميم كيف تتصرف الحروف سياقياً.

1. الأشكال الموضعية (Positional Forms): أساس الاتصال

بسبب طبيعة الأبجدية العربية، يتغير رسم الحرف آلياً بمجرد دخوله في كلمة. هذه الخصائص أصلية في المعمارية البرمجية للخط ولا يمكن الاستغناء عنها:

isol (Isolated): الحرف في حالته المستقلة النقية، عندما لا يتصل بما قبله أو بعده.
init (Initial): يُفعل آلياً في بداية الكلمة ليتجهز الحرف للاتصال بما بعده.
medi (Medial): يُفعل في وسط الكلمة للاتصال المزدوج من اليمين واليسار.
fina (Final): يُفعل في نهاية الكلمة ليكمل الاتصال بما قبله ويغلق مسار السطر.

2. التراكيب والروابط الخطية (Ligatures): ترويض المساحات

عملية الدمج ليست مجرد حيلة جمالية، بل هي ضرورة هندسية لمنع تداخل الحروف الحاد أو لحل مشاكل المساحة البصرية:

rlig (Required Ligatures): روابط إجبارية لا يقبل النص الخطأ فيها، وأبرزها تركيب (لام-ألف). بدون هذه الخاصية يتشوه النص لغوياً.
liga (Standard Ligatures): روابط افتراضية تُحسّن التدفق البصري، مثل تركيبات (في) أو (لم) في الخطوط النسخية التقليدية.
dlig (Discretionary Ligatures): تراكيب زخرفية اختيارية يُفعلها المستخدم لمسات فنية، كالبسملة والصلوات أو التراكيب الكوفية المركبة.
clig (Contextual Ligatures): روابط سياقية ذكية؛ تتأكد أولاً من الحروف المحيطة ثم تطبق الاستبدال لضمان عدم اصطدام النازل بالصاعد.

3. هندسة التشكيل والضبط الرأسي (Diacritics & Positioning)

ضبط علامات التشكيل على الحروف العربية كان دائماً تحدياً تقنياً، لكن خوارزميات الضبط الموضعي حلت هذه المعضلة بنجاح:

ccmp (Glyph Composition/Decomposition): ميزة تقوم بتجميع الحركات المتعددة (مثل الشدة مع الفتحة) في كائن برمجى واحد لتسهيل معالجته.
mark (Mark-to-Base): تحدد الإحداثيات الدقيقة لموقع الحركة فوق الحرف الأساسي أو تحته، بناءً على نقاط إرساء (Anchors) نضعها أثناء تصميم الخط في برنامج Glyphs.
mkmk (Mark-to-Mark): تمنع تصادم الحركات عندما تتراكم فوق بعضها (كوضع تنوين فوق حركة سابقة).

4. البدائل الجمالية والمجموعات الأسلوبية (Stylistic Sets)

تتيح هذه الميزات للمصمم منح خطه شخصيات متعددة دون الحاجة لإنشاء ملفات جديدة:

salt & aalt: نوافذ لاستعراض واختيار البدائل الفنية المتاحة للمحرف الواحد.
swsh (Swash): تنشيط امتدادات قوسية وانحناءات جمالية لنهايات الكلمات، كإرسال الراء أو النون.
jalt (Justification Alternates): توفير أشكال كشيدة ممتدة هندسياً للمساعدة في ضبط محاذاة الأسطر بدلاً من السحب العشوائي.
locl (Localized Forms): مواءمة أشكال المحارف حسب جغرافية الاستخدام؛ مثل إظهار الفاء والقاف بالنمط المغربي أو إظهار أشكال الأرقام والكتل المعتمدة في الأردية والفارسية.
ss01 - ss20 (Stylistic Sets): مجموعات أسلوبية تمكن المستخدم بضغطة زر واحدة من تحويل مظهر الخط كاملاً، مثلاً من نمط حديث معاصر إلى نمط كلاسيكي حاد.

تجربة عمل ميدانية: عند بناء الخطوط المتغيرة الشاملة في استوديو خطوط سلطان — مثل خط اوسان برو أو خط هاندكس — لا نكتفي ببرمجة calt التلقائية، بل نجمع بين الاستبدال السياقي الإجباري rclt لضمان عدم انكسار التوازن البصري أثناء حركة الوزن من النحيف إلى الأسود.

5. التباعد والربط المائل (Spacing, Kerning & Cursive)

curs (Cursive Attachment): الخاصية المسؤولة عن المحاذاة الراسية والعمودية المتصلة في الخطوط التي تجري على سطر مائل مثل النستعليق أو الرقعة.
kern (Kerning): ضبط المسافات الأفقية بين أزواج الحروف غير المتصلة (مثل الراء مع الألف) لإلغاء الفراغات البصرية المزعجة وجعل النص مريحاً للعين.

6. الأنظمة الرقمية (Numerical Systems)

pnum (Proportional Figures): أرقام تتكيف مساحتها بحسب عرض الرقم نفسه، ممتازة للنصوص المتصلة.
tnum (Tabular Figures): أرقام ذات عروض متساوية تماماً، وهي ضرورية جداً عند تصميم الجداول والبيانات المالية المحاذية.
frac (Fractions): تحويل الأرقام المفصولة بمسند إلى كسور طباعية متناسقة تلقائياً.

When a calligrapher writes on paper, their hand moves with an intuitive understanding of proportions, rhythm, and structural rules. In the digital realm, individual glyphs lack this inherent awareness. This is where the OpenType Specification—developed jointly by Microsoft and Adobe—steps in as the underlying logic engine that transforms static shapes into fluent, context-aware Arabic typography.

Unlike Latin scripts, Arabic typography is a continuous, connected system. It relies heavily on two primary lookup tables within the font binary: the Glyph Substitution table (GSUB) and the Glyph Positioning table (GPOS). Together, they dictate how characters interact dynamically based on their context.

1. Positional Forms: The Foundation of Connectivity

Due to the cursive nature of the Arabic alphabet, a glyph changes its visual representation depending on its position within a word. These layout features are hardcoded essentials:

isol (Isolated): The stand-alone form of a letter when unconnected on either side.
init (Initial): Triggered at the start of a word segment to prepare for forward connection.
medi (Medial): Activated in the middle of a sequence to join on both sides.
fina (Final): Applied at the end of a word segment to seal the stroke connection.

2. Ligatures: Managing Typographic Space

Ligatures in Arabic are not merely decorative flourishes; they are crucial engineering tools used to solve visual collisions and manage spatial balance:

rlig (Required Ligatures): Mandatory substitutions essential for orthographic correctness, such as the Lam-Alef combination.
liga (Standard Ligatures): Default typographic joins that enhance reading flow, especially in traditional Naskh styles.
dlig (Discretionary Ligatures): Optional artistic joinings enabled by the user for specialized calligraphic effects.
clig (Contextual Ligatures): Smart substitutions that inspect surrounding glyphs to prevent awkward ascender/descender collisions.

3. Diacritic Engineering and Vertical Positioning

Accurate placement of vocalization marks (Harakat) on Arabic letters used to be a technical hurdle. Modern OpenType positioning rules resolved this cleanly:

ccmp (Glyph Composition): Combines multiple stacked diacritics into a single logical unit for cleaner rendering.
mark (Mark-to-Base): Defines exact X/Y anchor coordinates to attach marks to base letters, defined using tools like Glyphs.
mkmk (Mark-to-Mark): Prevents diacritic collision when multiple marks stack vertically on top of one another.

4. Alternates & Stylistic Sets

These features grant designers the ability to embed versatile typographic personalities within a single font file:

salt & aalt: Primary interfaces for accessing all design variants of a given character.
swsh (Swash): Activates elegant terminal extensions and swooping tails on word endings.
jalt (Justification Alternates): Provides elongated character variants (Kashida) for precise line-justification.
locl (Localized Forms): Automatically swaps glyph shapes according to regional conventions, such as Maghrebi dot positions or Urdu language preferences.
ss01 - ss20 (Stylistic Sets): Global switches that alter the entire aesthetic tone of the typeface with a single click.

Field Insight: When developing complex variable type families at Sultan Fonts Studio—such as Handix or AusanPro—we combine optional calt logic with mandatory rclt features. This ensures that structural proportions remain rock-solid across all interpolation weights from Hairline to Black.

5. Spacing, Kerning, and Cursive Attachment

curs (Cursive Attachment): Manages smooth step-like vertical and horizontal connections required in slanted scripts like Nastaliq and Ruq'ah.
kern (Kerning): Fine-tunes horizontal distances between non-connecting character pairs to eliminate uncomfortable visual gaps.

6. Numerical Systems

pnum (Proportional Figures): Digits with variable widths designed to blend seamlessly within running body text.
tnum (Tabular Figures): Monospaced digits engineered for financial alignment and structured data tables.
frac (Fractions): Automatically converts slash-separated numbers into clean typographic fractions.

بقلم: سلطان المقطري | 24 يونيو 2025 | مصمم خطوط رقمية لأكثر من 20 عامًا (2003–الآن) By: Sultan Al-Maqtari | June 24, 2025 | Digital Type Designer with over 20 years of experience (2003–Present)